Add skip_initial_version_creation to kms crypto key (#3907) (#319)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2020-10-27 14:53:46 -07:00 committed by GitHub
parent ffa905b853
commit 40275f32da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View file

@ -99,6 +99,13 @@ options:
- 'Format: `''projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}''`.'
required: true
type: str
skip_initial_version_creation:
description:
- If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
You must use the `google_kms_key_ring_import_job` resource to import the CryptoKeyVersion.
required: false
default: 'false'
type: bool
project:
description:
- The Google Cloud Platform project to use.
@ -234,6 +241,12 @@ keyRing:
- 'Format: `''projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}''`.'
returned: success
type: str
skipInitialVersionCreation:
description:
- If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
You must use the `google_kms_key_ring_import_job` resource to import the CryptoKeyVersion.
returned: success
type: bool
'''
################################################################################
@ -267,6 +280,7 @@ def main():
rotation_period=dict(type='str'),
version_template=dict(type='dict', options=dict(algorithm=dict(required=True, type='str'), protection_level=dict(type='str'))),
key_ring=dict(required=True, type='str'),
skip_initial_version_creation=dict(type='bool'),
)
)
@ -356,7 +370,9 @@ def collection(module):
def create_link(module):
return "https://cloudkms.googleapis.com/v1/{key_ring}/cryptoKeys?cryptoKeyId={name}".format(**module.params)
return "https://cloudkms.googleapis.com/v1/{key_ring}/cryptoKeys?cryptoKeyId={name}&skipInitialVersionCreation={skip_initial_version_creation}".format(
**module.params
)
def return_if_object(module, response, allow_not_found=False):

View file

@ -171,6 +171,12 @@ resources:
- 'Format: `''projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}''`.'
returned: success
type: str
skipInitialVersionCreation:
description:
- If set to true, the request will create a CryptoKey without any CryptoKeyVersions.
You must use the `google_kms_key_ring_import_job` resource to import the CryptoKeyVersion.
returned: success
type: bool
'''
################################################################################