Add source snapshot to ansible (#300)

* Make `iap` field computed (#3814) (#272)

Signed-off-by: Modular Magician <magic-modules@google.com>

* add source_image and source_snapshot to google_compute_image (#3799) (#273)

* add source_image to google_compute_image

* add source_snapshot to google_compute_image

* PR comment changes

Signed-off-by: Modular Magician <magic-modules@google.com>

* Collection fixes for release (#3831) (#274)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add new field filter to pubsub. (#3759) (#275)

* Add new field filter to pubsub.

Fixes: https://github.com/terraform-providers/terraform-provider-google/issues/6727

* Fixed filter name, it was improperly set.

* add filter key to pubsub subscription unit test

* spaces not tabs!

* hardcode filter value in test

* revert remove escaped quotes

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>

* Add archive class to gcs (#3867) (#276)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add support for gRPC healthchecks (#3825) (#277)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add enableMessageOrdering to Pub/Sub Subscription (#3872) (#278)

Add enableMessageOrdering to Pub/Sub Subscription

Signed-off-by: Modular Magician <magic-modules@google.com>

* use {product}.googleapis.com endpoints (#3755) (#279)

* use {product}.googleapis.com endpoints

* use actual correct urls

* fix zone data source test

* fix network peering tests

* possibly fix deleting default network

Signed-off-by: Modular Magician <magic-modules@google.com>

* Removed instances where input and output are both true (#3890) (#280)

* [provider-yaml] - Removed instances where input and output are both true

* modified to only supply output. Following pattern from bigquerydatatransfer

Co-authored-by: Scott Suarez <scottsuarez@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Scott Suarez <scottsuarez@google.com>

* retrypolicy attribute added (#3843) (#281)

* retrypolicy attribute added

* test case updated

Signed-off-by: Modular Magician <magic-modules@google.com>

* Advanced logging config options in google_compute_subnetwork (#3603) (#282)

Co-authored-by: Dana Hoffman <danahoffman@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Dana Hoffman <danahoffman@google.com>

* Add Erase Windows VSS support to compute disk (#3898) (#283)

Co-authored-by: Cameron Thornton <camthornton@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Cameron Thornton <camthornton@google.com>

* Add Snapshot location to compute snapshot (#3896) (#286)

* added storage locations

* add storage locations to field

* tweak cmek logic

* fix the decoder logic and cleanup whitespaces

* remove duplicate entry

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added missing 'all' option for protocol firewall rule (#3962) (#287)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added support GRPC for google_compute_(region)_backend_service.protocol (#3973) (#289)

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Add schema update support to spanner db 2082 (#3947) (#291)

* eoncders and customdiff added for spanner DB ddl update

* config update test case added

* customdiff modified to handle out-of-index issue

* new lines added

* indent fixed

* indent fixed for tests

* test added for ddl update condition

* mock added Terraformresourcediff, unit tests added

* test fixed

* more unit tests added

* tests fixed

* PR comments implemented

* unit tests converted to table driven tests

* ImportStateVerifyIgnore flag added to tests

* syntax corrected in test

Signed-off-by: Modular Magician <magic-modules@google.com>

* Added properties of options & artifacts on google_cloudbuild_trigger (#3944) (#292)

* added options & artifacts to cloudbuild trigger

* updated with minor changes and added more options in test

* a test adding update behavior for multiple optional fields

Co-authored-by: Edward Sun <sunedward@google.com>
Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Edward Sun <sunedward@google.com>

* Enable TPUs to use Shared VPC (#3939) (#293)

* add support for shared vpc

* make cidr_block computable

* add diffsuppression

* tweak diffsupression to ignore when network has a change

* rework diffsupress

* add customizediff

* switch the diff checks

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add SEV_CAPABLE option to google_compute_image (#3994) (#294)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update docs for pubsub targets in cloud scheduler (#4008) (#295)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Make RegionBackendService health checks optional (#4053) (#297)

Signed-off-by: Modular Magician <magic-modules@google.com>

* Update terminology for IAM roles (#4056) (#299)

Roles like "Owner" and "Editor" are now called "basic roles": https://cloud.google.com/iam/docs/understand

Signed-off-by: Modular Magician <magic-modules@google.com>

* Add source snapshot to ansible (#4060)

Signed-off-by: Modular Magician <magic-modules@google.com>

Co-authored-by: Tim O'Connell <hi@timoconnell.co.uk>
Co-authored-by: Scott Suarez <scottsuarez@google.com>
Co-authored-by: Dana Hoffman <danahoffman@google.com>
Co-authored-by: Cameron Thornton <camthornton@google.com>
Co-authored-by: Edward Sun <sunedward@google.com>
This commit is contained in:
The Magician 2020-10-06 15:39:08 -07:00 committed by GitHub
parent fb1485be7b
commit 7fa00db18c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
169 changed files with 2105 additions and 764 deletions

View file

@ -43,7 +43,6 @@ description:
You can create a custom image from root persistent disks and other images. Then,
use the custom image to create an instance.
short_description: Creates a GCP Image
version_added: '2.6'
author: Google Inc. (@googlecloudplatform)
requirements:
- python >= 2.6
@ -88,8 +87,8 @@ options:
type:
description:
- The type of supported feature.
- 'Some valid choices include: "MULTI_IP_SUBNET", "SECURE_BOOT", "UEFI_COMPATIBLE",
"VIRTIO_SCSI_MULTIQUEUE", "WINDOWS"'
- 'Some valid choices include: "MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE",
"UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS"'
required: true
type: str
image_encryption_key:
@ -111,7 +110,6 @@ options:
- Labels to apply to this Image.
required: false
type: dict
version_added: '2.8'
licenses:
description:
- Any applicable license URI.
@ -186,6 +184,31 @@ options:
of a given disk name.
required: false
type: str
source_image:
description:
- 'URL of the source image used to create this image. In order to create an image,
you must provide the full or partial URL of one of the following: The selfLink
URL This property The rawDisk.source URL The sourceDisk URL .'
- 'This field represents a link to a Image resource in GCP. It can be specified
in two ways. First, you can place a dictionary with key ''selfLink'' and value
of your resource''s selfLink Alternatively, you can add `register: name-of-resource`
to a gcp_compute_image task and then set this source_image field to "{{ name-of-resource
}}"'
required: false
type: dict
source_snapshot:
description:
- URL of the source snapshot used to create this image.
- 'In order to create an image, you must provide the full or partial URL of one
of the following: The selfLink URL This property The sourceImage URL The rawDisk.source
URL The sourceDisk URL .'
- 'This field represents a link to a Snapshot resource in GCP. It can be specified
in two ways. First, you can place a dictionary with key ''selfLink'' and value
of your resource''s selfLink Alternatively, you can add `register: name-of-resource`
to a gcp_compute_snapshot task and then set this source_snapshot field to "{{
name-of-resource }}"'
required: false
type: dict
source_type:
description:
- The type of the image used to create this disk. The default and only value is
@ -224,6 +247,7 @@ options:
description:
- Array of scopes to be used
type: list
elements: str
env_type:
description:
- Specifies which Ansible environment you're running this module within.
@ -460,6 +484,21 @@ sourceDiskId:
of a given disk name.
returned: success
type: str
sourceImage:
description:
- 'URL of the source image used to create this image. In order to create an image,
you must provide the full or partial URL of one of the following: The selfLink
URL This property The rawDisk.source URL The sourceDisk URL .'
returned: success
type: dict
sourceSnapshot:
description:
- URL of the source snapshot used to create this image.
- 'In order to create an image, you must provide the full or partial URL of one
of the following: The selfLink URL This property The sourceImage URL The rawDisk.source
URL The sourceDisk URL .'
returned: success
type: dict
sourceType:
description:
- The type of the image used to create this disk. The default and only value is
@ -507,6 +546,8 @@ def main():
source_disk=dict(type='dict'),
source_disk_encryption_key=dict(type='dict', options=dict(raw_key=dict(type='str'))),
source_disk_id=dict(type='str'),
source_image=dict(type='dict'),
source_snapshot=dict(type='dict'),
source_type=dict(type='str'),
)
)
@ -560,7 +601,7 @@ def update_fields(module, request, response):
def labels_update(module, request, response):
auth = GcpSession(module, 'compute')
auth.post(
''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/images/{name}/setLabels"]).format(**module.params),
''.join(["https://compute.googleapis.com/compute/v1/", "projects/{project}/global/images/{name}/setLabels"]).format(**module.params),
{u'labels': module.params.get('labels'), u'labelFingerprint': response.get('labelFingerprint')},
)
@ -585,6 +626,8 @@ def resource_to_request(module):
u'sourceDisk': replace_resource_dict(module.params.get(u'source_disk', {}), 'selfLink'),
u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(module.params.get('source_disk_encryption_key', {}), module).to_request(),
u'sourceDiskId': module.params.get('source_disk_id'),
u'sourceImage': replace_resource_dict(module.params.get(u'source_image', {}), 'selfLink'),
u'sourceSnapshot': replace_resource_dict(module.params.get(u'source_snapshot', {}), 'selfLink'),
u'sourceType': module.params.get('source_type'),
}
return_vals = {}
@ -601,11 +644,11 @@ def fetch_resource(module, link, kind, allow_not_found=True):
def self_link(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/images/{name}".format(**module.params)
return "https://compute.googleapis.com/compute/v1/projects/{project}/global/images/{name}".format(**module.params)
def collection(module):
return "https://www.googleapis.com/compute/v1/projects/{project}/global/images".format(**module.params)
return "https://compute.googleapis.com/compute/v1/projects/{project}/global/images".format(**module.params)
def return_if_object(module, response, kind, allow_not_found=False):
@ -668,6 +711,8 @@ def response_to_hash(module, response):
u'sourceDisk': response.get(u'sourceDisk'),
u'sourceDiskEncryptionKey': ImageSourcediskencryptionkey(response.get(u'sourceDiskEncryptionKey', {}), module).from_response(),
u'sourceDiskId': response.get(u'sourceDiskId'),
u'sourceImage': response.get(u'sourceImage'),
u'sourceSnapshot': response.get(u'sourceSnapshot'),
u'sourceType': response.get(u'sourceType'),
}
@ -675,16 +720,16 @@ def response_to_hash(module, response):
def license_selflink(name, params):
if name is None:
return
url = r"https://www.googleapis.com/compute/v1//projects/.*/global/licenses/.*"
url = r"https://compute.googleapis.com/compute/v1//projects/.*/global/licenses/.*"
if not re.match(url, name):
name = "https://www.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name
name = "https://compute.googleapis.com/compute/v1//projects/{project}/global/licenses/%s".format(**params) % name
return name
def async_op_url(module, extra_data=None):
if extra_data is None:
extra_data = {}
url = "https://www.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
url = "https://compute.googleapis.com/compute/v1/projects/{project}/global/operations/{op_id}"
combined = extra_data.copy()
combined.update(module.params)
return url.format(**combined)