Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource google_endpoints_service_consumers_iam #5836

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions mmv1/products/servicemanagement/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,18 @@ objects:
name: 'serviceName'
description: The name of the service.
required: true
- !ruby/object:Api::Resource
name: 'ServiceConsumers'
base_url: services/{{service_name}}/consumers/{{consumer_project}}
self_link: services/{{service_name}}/consumers/{{consumer_project}}
description: |
A service that is managed by Google Service Management
properties:
- !ruby/object:Api::Type::String
name: 'serviceName'
description: The name of the service.
required: true
- !ruby/object:Api::Type::String
name: 'consumerProject'
description: The service consumer project ID which you are granting permission to
required: true
23 changes: 23 additions & 0 deletions mmv1/products/servicemanagement/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ overrides: !ruby/object:Overrides::ResourceOverrides
name: "endpoint"
test_env_vars:
project_name: :PROJECT_NAME
ServiceConsumers: !ruby/object:Overrides::Terraform::ResourceOverride
legacy_name: google_endpoints_service_consumers
id_format: 'services/{{service_name}}/consumers/{{consumer_project}}'
import_format: ["services/{{service_name}}/consumers/{{consumer_project}}", "{{consumer_project}}"]
exclude_resource: true
iam_policy: !ruby/object:Api::Resource::IamPolicy
method_name_separator: ':'
parent_resource_type: 'google_endpoints_service'
parent_resource_attribute: 'consumer_project'
allowed_iam_role: 'roles/servicemanagement.serviceController'
fetch_iam_policy_verb: :POST
example_config_body: 'templates/terraform/iam/example_config_body/service_management_consumer.tf.erb'
examples:
- !ruby/object:Provider::Terraform::Examples
name: "endpoints_iam"
primary_resource_id: "endpoints_service"
primary_resource_name: "fmt.Sprintf(\"endpoint%s.endpoints.%s.cloud.goog\", context[\"random_suffix\"], context[\"project_name\"]), context[\"project_name\"]"
vars:
name: "endpoint"
test_env_vars:
project_name: :PROJECT_NAME
ScottSuarez marked this conversation as resolved.
Show resolved Hide resolved
consumer_project: :PROJECT_NAME

# This is for copying files over
files: !ruby/object:Provider::Config::Files
# These files have templating (ERB) code that will be run.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name = google_endpoints_service.endpoints_service.service_name
consumer_project = "%{consumer_project}"