Skip to content

Commit 866c2bf

Browse files
committed
Automatically generated by magic modules for service: secretmanagerregional and resource: Secret
Signed-off-by: abheda-crest <[email protected]>
1 parent 79411a1 commit 866c2bf

10 files changed

+459
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ The following resources are available in the InSpec GCP Profile
367367
| [google_runtime_config_config_iam_policy](docs/resources/google_runtime_config_config_iam_policy.md) | No Plural Resource |
368368
| [google_runtime_config_variable](docs/resources/google_runtime_config_variable.md) | [google_runtime_config_variables](docs/resources/google_runtime_config_variables.md) |
369369
| [google_secret_manager_secret](docs/resources/google_secret_manager_secret.md) | [google_secret_manager_secrets](docs/resources/google_secret_manager_secrets.md) |
370+
| [google_secret_manage_regional_secret](docs/resources/google_secret_manager_regional_secret.md) | [google_secret_manager_regional_secrets](docs/resources/google_secret_manager_regional_secrets.md) |
370371
| [google_service_account](docs/resources/google_service_account.md) | [google_service_accounts](docs/resources/google_service_accounts.md) |
371372
| No Singular Resource | [google_service_networking_service_connections](docs/resources/google_service_networking_service_connections.md) |
372373
| [google_service_account_key](docs/resources/google_service_account_key.md) | [google_service_account_keys](docs/resources/google_service_account_keys.md) |
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: About the google_secret_manager_regional_secret resource
3+
platform: gcp
4+
---
5+
6+
## Syntax
7+
A `google_secret_manager_regional_secret` is used to test a Google Regional Secret resource
8+
9+
## Examples
10+
```
11+
describe google_secret_manager_regional_secret(name: 'projects/<project>/locations/<location>/secrets/<secret>', region: 'value_region') do
12+
it { should exist }
13+
14+
end
15+
16+
describe google_secret_manager_regional_secret(name: "does_not_exit", region: 'value_region') do
17+
it { should_not exist }
18+
end
19+
```
20+
21+
## Properties
22+
Properties that can be accessed from the `google_secret_manager_regional_secret` resource:
23+
24+
25+
* `name`: The resource name of the Regional Secret. Format: `projects/{{project}}/locations/{{location}}/secrets/{{secret_id}}`
26+
27+
* `create_time`: The time at which the Regional Secret was created.
28+
29+
* `labels`: The labels assigned to this Regional Secret. Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes, and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} No more than 64 labels can be assigned to a given resource. An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
30+
31+
* `annotations`: Custom metadata about the regional secret.
32+
Annotations are distinct from various forms of labels. Annotations exist to allow
33+
client tools to store their own state information without requiring a database.
34+
Annotation keys must be between 1 and 63 characters long, have a UTF-8 encoding of
35+
maximum 128 bytes, begin and end with an alphanumeric character ([a-z0-9A-Z]), and
36+
may have dashes (-), underscores (_), dots (.), and alphanumerics in between these
37+
symbols.
38+
The total size of annotation keys and values must be less than 16KiB.
39+
40+
* `customer_managed_encryption`: Customer Managed Encryption for the secret.
41+
42+
* `kms_key_name`: Describes the Cloud KMS encryption key that will be used to protect destination secret.
43+
44+
* `topics`: A list of up to 10 Pub/Sub topics to which messages are published when control plane operations are called on the secret or its versions.
45+
46+
* `name`: The resource name of the Pub/Sub topic that will be published to, in the following format: projects/*/topics/*. For publication to succeed, the Secret Manager Service Agent service account must have pubsub.publisher permissions on the topic.
47+
48+
* `expire_time`: Timestamp in UTC when the Secret is scheduled to expire. This is always provided on output, regardless of what was sent on input. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
49+
50+
* `ttl`: The TTL for the Secret. A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
51+
52+
* `version_destroy_ttl`: Secret Version TTL after destruction request. This is a part of the delayed delete feature on Secret Version. For secret with versionDestroyTtl>0, version destruction doesn't happen immediately on calling destroy instead the version goes to a disabled state and the actual destruction happens after this TTL expires. It must be atleast 24h.
53+
54+
* `rotation`: The rotation time and period for a Secret. At `next_rotation_time`, Secret Manager will send a Pub/Sub notification to the topics configured on the Secret. `topics` must be set to configure rotation.
55+
56+
* `next_rotation_time`: Timestamp in UTC at which the Secret is scheduled to rotate. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
57+
58+
* `rotation_period`: The Duration between rotation notifications. Must be in seconds and at least 3600s (1h) and at most 3153600000s (100 years). If rotationPeriod is set, `next_rotation_time` must be set. `next_rotation_time` will be advanced by this period when the service automatically sends rotation notifications.
59+
60+
61+
## GCP Permissions
62+
63+
Ensure the [Secret Manager API](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com/) is enabled for the current project.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: About the google_secret_manager_regional_secrets resource
3+
platform: gcp
4+
---
5+
6+
## Syntax
7+
A `google_secret_manager_regional_secrets` is used to test a Google Regional Secret resource
8+
9+
## Examples
10+
```
11+
describe google_secret_manager_regional_secrets(parent: ' value_parent', region: 'value_region') do
12+
it { should exist }
13+
end
14+
```
15+
16+
## Properties
17+
Properties that can be accessed from the `google_secret_manager_regional_secrets` resource:
18+
19+
See [google_secret_manager_regional_secret.md](google_secret_manager_regional_secret.md) for more detailed information
20+
* `names`: an array of `google_secret_manager_regional_secret` name
21+
* `create_times`: an array of `google_secret_manager_regional_secret` create_time
22+
* `annotations`: an array of `google_secret_manager_regional_secret` annotation
23+
* `labels`: an array of `google_secret_manager_regional_secret` labels
24+
* `topics`: an array of `google_secret_manager_regional_secret` topics
25+
* `expire_times`: an array of `google_secret_manager_regional_secret` expire_time
26+
* `ttls`: an array of `google_secret_manager_regional_secret` ttl
27+
* `rotations`: an array of `google_secret_manager_regional_secret` rotation
28+
* `customer_managed_encryptions`: an array of `google_secret_manager_regional_secret` customer_managed_encryption
29+
* `version_destroy_ttl`: an array of `google_secret_manager_regional_secret` version_destroy_ttl
30+
31+
## Filter Criteria
32+
This resource supports all of the above properties as filter criteria, which can be used
33+
with `where` as a block or a method.
34+
35+
## GCP Permissions
36+
37+
Ensure the [Secret Manager Regional API](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com/) is enabled for the current project.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# frozen_string_literal: false
2+
3+
# ----------------------------------------------------------------------------
4+
#
5+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
6+
#
7+
# ----------------------------------------------------------------------------
8+
#
9+
# This file is automatically generated by Magic Modules and manual
10+
# changes will be clobbered when the file is regenerated.
11+
#
12+
# Please read more about how to change this file in README.md and
13+
# CONTRIBUTING.md located at the root of this package.
14+
#
15+
# ----------------------------------------------------------------------------
16+
module GoogleInSpec
17+
module SecretManagerRegional
18+
module Property
19+
class SecretCustomerManagedEncryption
20+
attr_reader :kms_key_name
21+
22+
def initialize(args = nil, parent_identifier = nil)
23+
return if args.nil?
24+
@parent_identifier = parent_identifier
25+
@kms_key_name = args['kmsKeyName']
26+
end
27+
28+
def to_s
29+
"#{@parent_identifier} SecretCustomerManagedEncryption"
30+
end
31+
end
32+
33+
class SecretCustomerManagedEncryptionArray
34+
def self.parse(value, parent_identifier)
35+
return if value.nil?
36+
return SecretCustomerManagedEncryption.new(value, parent_identifier) unless value.is_a?(::Array)
37+
value.map { |v| SecretCustomerManagedEncryption.new(v, parent_identifier) }
38+
end
39+
end
40+
end
41+
end
42+
end
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# frozen_string_literal: false
2+
3+
# ----------------------------------------------------------------------------
4+
#
5+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
6+
#
7+
# ----------------------------------------------------------------------------
8+
#
9+
# This file is automatically generated by Magic Modules and manual
10+
# changes will be clobbered when the file is regenerated.
11+
#
12+
# Please read more about how to change this file in README.md and
13+
# CONTRIBUTING.md located at the root of this package.
14+
#
15+
# ----------------------------------------------------------------------------
16+
module GoogleInSpec
17+
module SecretManagerRegional
18+
module Property
19+
class SecretRotation
20+
attr_reader :next_rotation_time
21+
22+
attr_reader :rotation_period
23+
24+
def initialize(args = nil, parent_identifier = nil)
25+
return if args.nil?
26+
@parent_identifier = parent_identifier
27+
@next_rotation_time = args['nextRotationTime']
28+
@rotation_period = args['rotationPeriod']
29+
end
30+
31+
def to_s
32+
"#{@parent_identifier} SecretRotation"
33+
end
34+
end
35+
end
36+
end
37+
end
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# frozen_string_literal: false
2+
3+
# ----------------------------------------------------------------------------
4+
#
5+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
6+
#
7+
# ----------------------------------------------------------------------------
8+
#
9+
# This file is automatically generated by Magic Modules and manual
10+
# changes will be clobbered when the file is regenerated.
11+
#
12+
# Please read more about how to change this file in README.md and
13+
# CONTRIBUTING.md located at the root of this package.
14+
#
15+
# ----------------------------------------------------------------------------
16+
module GoogleInSpec
17+
module SecretManagerRegional
18+
module Property
19+
class SecretTopics
20+
attr_reader :name
21+
22+
def initialize(args = nil, parent_identifier = nil)
23+
return if args.nil?
24+
@parent_identifier = parent_identifier
25+
@name = args['name']
26+
end
27+
28+
def to_s
29+
"#{@parent_identifier} SecretTopics"
30+
end
31+
end
32+
33+
class SecretTopicsArray
34+
def self.parse(value, parent_identifier)
35+
return if value.nil?
36+
return SecretTopics.new(value, parent_identifier) unless value.is_a?(::Array)
37+
value.map { |v| SecretTopics.new(v, parent_identifier) }
38+
end
39+
end
40+
end
41+
end
42+
end
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# frozen_string_literal: false
2+
3+
# ----------------------------------------------------------------------------
4+
#
5+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
6+
#
7+
# ----------------------------------------------------------------------------
8+
#
9+
# This file is automatically generated by Magic Modules and manual
10+
# changes will be clobbered when the file is regenerated.
11+
#
12+
# Please read more about how to change this file in README.md and
13+
# CONTRIBUTING.md located at the root of this package.
14+
#
15+
# ----------------------------------------------------------------------------
16+
require 'gcp_backend'
17+
require 'google/secretmanagerregional/property/secret_customer_managed_encryption'
18+
require 'google/secretmanagerregional/property/secret_rotation'
19+
require 'google/secretmanagerregional/property/secret_topics'
20+
21+
# A provider to manage Secret Manager resources.
22+
class SecretManagerRegionalSecret < GcpResourceBase
23+
name 'google_secret_manager_regional_secret'
24+
desc 'Secret'
25+
supports platform: 'gcp'
26+
27+
attr_reader :params
28+
attr_reader :name
29+
attr_reader :create_time
30+
attr_reader :annotations
31+
attr_reader :labels
32+
attr_reader :topics
33+
attr_reader :expire_time
34+
attr_reader :customer_managed_encryption
35+
attr_reader :version_destroy_ttl
36+
attr_reader :version_aliases
37+
attr_reader :rotation
38+
39+
def initialize(params)
40+
super(params.merge({ use_http_transport: true }))
41+
@params = params
42+
@fetched = @connection.fetch(product_url(params[:beta]), resource_base_url, params, 'Get')
43+
parse unless @fetched.nil?
44+
end
45+
46+
def parse
47+
@name = @fetched['name']
48+
@create_time = @fetched['createTime']
49+
@annotations = @fetched['annotations']
50+
@labels = @fetched['labels']
51+
@topics = GoogleInSpec::SecretManagerRegional::Property::SecretTopicsArray.parse(@fetched['topics'], to_s)
52+
@expire_time = @fetched['expireTime']
53+
@customer_managed_encryption = GoogleInSpec::SecretManagerRegional::Property::SecretCustomerManagedEncryptionArray.parse(@fetched['customerManagedEncryption'], to_s)
54+
@version_destroy_ttl = @fetched['versionDestroyTtl']
55+
@version_aliases = @fetched['versionAliases']
56+
@rotation = GoogleInSpec::SecretManagerRegional::Property::SecretRotation.new(@fetched['rotation'], to_s)
57+
end
58+
59+
def exists?
60+
!@fetched.nil?
61+
end
62+
63+
def to_s
64+
"Secret #{@params[:name]}"
65+
end
66+
67+
private
68+
69+
def product_url(_ = nil)
70+
'https://secretmanager.{{region}}.rep.googleapis.com/v1/'
71+
end
72+
73+
def resource_base_url
74+
'{{name}}'
75+
end
76+
end

0 commit comments

Comments
 (0)