diff --git a/mmv1/products/apigee/api.yaml b/mmv1/products/apigee/api.yaml index 7b47cb05780d..3f0c46710d8a 100644 --- a/mmv1/products/apigee/api.yaml +++ b/mmv1/products/apigee/api.yaml @@ -231,6 +231,13 @@ objects: message: 'message' description: | An `Environment` in Apigee. + iam_policy: !ruby/object:Api::Resource::IamPolicy + exclude: false + method_name_separator: ':' + parent_resource_attribute: 'env_id' + import_format: ["{{%org_id}}/environments/{{name}}", "{{name}}"] + base_url: "{{org_id}}/environments/{{name}}" + self_link: "{{org_id}}/environments/{{name}}" parameters: - !ruby/object:Api::Type::String name: 'orgId' diff --git a/mmv1/products/apigee/terraform.yaml b/mmv1/products/apigee/terraform.yaml index f03a51961c53..d3e700cecc20 100644 --- a/mmv1/products/apigee/terraform.yaml +++ b/mmv1/products/apigee/terraform.yaml @@ -103,6 +103,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides # the resources needed for the acceptance test. name: "apigee_environment_basic_test" primary_resource_id: "apigee_environment" + primary_resource_name: "fmt.Sprintf(\"organizations/tf-test%s\", context[\"random_suffix\"]), fmt.Sprintf(\"tf-test%s\", context[\"random_suffix\"])" test_env_vars: org_id: :ORG_ID billing_account: :BILLING_ACCT diff --git a/mmv1/templates/terraform/encoders/apigee_organization.go.erb b/mmv1/templates/terraform/encoders/apigee_organization.go.erb index 0db9f52cccae..03c99cada236 100644 --- a/mmv1/templates/terraform/encoders/apigee_organization.go.erb +++ b/mmv1/templates/terraform/encoders/apigee_organization.go.erb @@ -1,2 +1,2 @@ obj["name"] = d.Get("project_id").(string) -return obj, nil \ No newline at end of file +return obj, nil diff --git a/mmv1/templates/terraform/examples/apigee_organization_cloud_full.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_cloud_full.tf.erb index a8435eba3343..891fb47422a9 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_cloud_full.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_cloud_full.tf.erb @@ -59,4 +59,4 @@ resource "google_apigee_organization" "org" { google_service_networking_connection.apigee_vpc_connection, google_kms_crypto_key_iam_binding.apigee_sa_keyuser, ] -} \ No newline at end of file +} diff --git a/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb b/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb index bb059d56a92b..32b47756f31a 100644 --- a/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb +++ b/mmv1/templates/terraform/examples/apigee_organization_cloud_full_test.tf.erb @@ -111,4 +111,4 @@ resource "google_apigee_organization" "<%= ctx[:primary_resource_id] %>" { google_service_networking_connection.apigee_vpc_connection, google_kms_crypto_key_iam_binding.apigee_sa_keyuser, ] -} \ No newline at end of file +} diff --git a/mmv1/templates/terraform/iam/iam_attributes.tf.erb b/mmv1/templates/terraform/iam/iam_attributes.tf.erb index a67618cf232a..171e3f258e28 100644 --- a/mmv1/templates/terraform/iam/iam_attributes.tf.erb +++ b/mmv1/templates/terraform/iam/iam_attributes.tf.erb @@ -1,6 +1,11 @@ +<% example = object.examples.reject(&:skip_test) + .reject { |e| @api.version_obj_or_closest(version) < @api.version_obj_or_closest(e.min_version) } + .first -%> +<% if !example -%> <% example = object.examples .reject { |e| @api.version_obj_or_closest(version) < @api.version_obj_or_closest(e.min_version) } - .first -%> + .first -%> +<% end -%> <% self_link_url = object.iam_policy.self_link || object.self_link_url -%> <% parent_resource_last_param_name = extract_identifiers(self_link_url).last -%> <% parent_resource_type_type = object.iam_policy.parent_resource_type || resource_ns -%> @@ -11,4 +16,4 @@ <% attribute_val = p.underscore -%> <% end -%> <%= attribute_val.underscore -%> = <%= parent_resource_type_type -%>.<%= example.primary_resource_id -%>.<%= p.underscore %> -<% end -%> \ No newline at end of file +<% end -%>