blob: 60936e997dc84b139e1c42711b8b236c1dada4ab [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Compute Engine"
description: |-
A datasource to retrieve the IAM policy state for Compute Engine Instance
---
# `google_compute_instance_iam_policy`
Retrieves the current IAM policy data for instance
## example
```hcl
data "google_compute_instance_iam_policy" "policy" {
project = google_compute_instance.default.project
zone = google_compute_instance.default.zone
instance_name = google_compute_instance.default.name
}
```
## Argument Reference
The following arguments are supported:
* `instance_name` - (Required) Used to find the parent resource to bind the IAM policy to
* `zone` - (Optional) A reference to the zone where the machine resides. Used to find the parent resource to bind the IAM policy to. If not specified,
the value will be parsed from the identifier of the parent resource. If no zone is provided in the parent identifier and no
zone is specified, it is taken from the provider configuration.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
## Attributes Reference
The attributes are exported:
* `etag` - (Computed) The etag of the IAM policy.
* `policy_data` - (Required only by `google_compute_instance_iam_policy`) The policy data generated by
a `google_iam_policy` data source.