Skip to content

Commit

Permalink
split remaining api.yaml (GoogleCloudPlatform#7407)
Browse files Browse the repository at this point in the history
Adding AuthorizedOrgsDesc to AccessContextManager (GoogleCloudPlatform#7178)

Allow project field in Firebase apps datasource (GoogleCloudPlatform#7300)

* Allow project field in Firebase apps datasource

* Add tf_test to the display name

* update to capitalized dependencies
Rename compute_(region)_per_instance_config test files to .erb files … (GoogleCloudPlatform#7409)

* Rename compute_(region)_per_instance_config test files to .erb files since the resources have fields in beta.

* Omit stateful_ip tests for GA
Bootstrap network cleanup (GoogleCloudPlatform#7367)

* Update bootstrapped networks for alloydb

* Update bootstrapped networks for redis

* Update bootstrapped networks for vertexai

* Update comment for BootstrapSharedTestNetwork to be more clear
Fix override directory concat (GoogleCloudPlatform#7413)

Bootstrap required permissions for composer environment tests (GoogleCloudPlatform#7391)

* Bootstrap the required permissions

* Make BootstrapAllPSARoles actually work

Also adds some helper functions for debugging what the bootstrap
function does. It will now log the roles that were missing in the
policy.

* Add missing return, fix nits

* Fix typo in service agent name

* Account for newly exported test functions
Add maintenance_interval field to Instance Template and Instance scheduling. (GoogleCloudPlatform#7365)

* Move testing to handwritten

* Move testing to handwritten

* Fix lint

* Fix typo

* Add remove step and update documentation

* Add remove step and update documentation

* Fix comparing string to nil

* Add field to handwritten defs

* rebase on main & resolve conflicts

* Fix doc formatting

* Add maintenance interval to Instance resource

* Add maintenance interval to Instance resource

* Add maintenance interval to Instance resource

* Change function names to valid

* Fix type mismatch

* Fix type mismatch

* Fix function name
Fix naming of resource policies in tests to be sweepable (GoogleCloudPlatform#7412)

Skip TestAccWorkstationsWorkstationConfig_workstationConfigEncryptionKeyExample (GoogleCloudPlatform#7415)

Add support for Apigee Sharedflow (GoogleCloudPlatform#7202)

* added sharedflows mmv1 with error

* fix indentation issue for sharedflow

* add semi auto generated resourceApigeeSharedFlow

* remove sharedflow mmv1 and add sharedflow manual provider

* adding files for debugging review, test have issue

* adding files for debugging review, test have issue

* update test, doc, provider for apigee

* Update api.yaml

remove empty new line

* Update api.yaml

* Rename resource_apigee_shared_flow_generated_test.go to resource_apigee_shared_flow_test.go

* Update resource_apigee_shared_flow.go

update import regex, change debug messages to log.Printf

* Update mmv1/third_party/terraform/utils/provider.go.erb

Co-authored-by: megan07 <mbang@hashicorp.com>

* update PR to address comments

* update test

* fix sharedflow attribute update issue, add sharedflow deployment

* Update apigee_shared_flow_deployment.html.markdown

minor doc fix

* Update mmv1/third_party/terraform/utils/provider.go.erb

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update mmv1/third_party/terraform/website/docs/r/apigee_shared_flow.html.markdown

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update resource_apigee_shared_flow_test.go

remove commented out (unused) line of code

* Delete api.yaml

remove api.yaml as it is not needed for handwritten resource. Current repo structure no longer uses aggregated api.yaml

* Rename apigee_shared_flow.html.markdown to apigee_sharedflow.html.markdown

* Rename apigee_shared_flow_deployment.html.markdown to apigee_sharedflow_deployment.html.markdown

* Rename resource_apigee_shared_flow.go to resource_apigee_sharedflow.go

* Rename resource_apigee_shared_flow_deployment_test.go to resource_apigee_sharedflow_deployment_test.go

* Rename resource_apigee_shared_flow_test.go to resource_apigee_sharedflow_test.go

* Rename resource_apigee_shared_flow_sweeper_test.go to resource_apigee_sharedflow_sweeper_test.go

* Update resource_apigee_sharedflow.go

remove comment lines

* Update mmv1/third_party/terraform/resources/resource_apigee_sharedflow.go

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update resource_apigee_sharedflow_deployment_test.go

remove unused debugging log

* update function name to capitalize

* Update resource_apigee_sharedflow_deployment_test.go

remove fmt.print

* add flowhook

* move flowhook doc

* Update mmv1/third_party/terraform/tests/resource_apigee_flowhook_test.go

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update mmv1/third_party/terraform/website/docs/r/apigee_flowhook.html.markdown

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update mmv1/third_party/terraform/website/docs/r/apigee_flowhook.html.markdown

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update mmv1/third_party/terraform/tests/resource_apigee_flowhook_test.go

Co-authored-by: megan07 <mbang@hashicorp.com>

* Update resource_apigee_flowhook_test.go

remove fmt.print

* update some resource attribute properties

* Update apigee_flowhook.html.markdown

updated `description` and `continue_on_error` as optional

* update referenced function naming case

---------

Co-authored-by: Ray Xu <xrc@google.com>
Co-authored-by: megan07 <mbang@hashicorp.com>
add tests (GoogleCloudPlatform#7357)

Co-authored-by: Edward Sun <sunedward@google.com>
run gofmt + fix capitalization errors from previous PRs (GoogleCloudPlatform#7420)

switch ci secrets to use secret manager (GoogleCloudPlatform#7408)

Update field descriptions (GoogleCloudPlatform#7402)

HA VPN over Cloud Interconnect has launched in GA
We should still probably add a sample or two showing how to use it.
Document PRODUCT_BASE_PATH override for DCL resource IAM (GoogleCloudPlatform#7418)

yaqs/1723187608399380480
Add support for accelerators to google_datafusion_instance (GoogleCloudPlatform#6851)

Added support to the field for Data Fusion, updated corresponding generated and handwritten tests, and added a custom diffsuppressfunc.

Currently suggests a manual fix to a potential diff issue, will be able to update down line based on feedback from API team.
Fix alloydb_cluster permadiff (GoogleCloudPlatform#7421)

Fix dns_managed_zone tests using unverified domain (GoogleCloudPlatform#7422)

Add SKIP_PROJECT_SWEEPER env variable for skipping the project sweeper (GoogleCloudPlatform#7432)

Remove percent sign when parsing metadata name (GoogleCloudPlatform#7417)

* Remove percent sign when parsing metadata name

* Remove percent sign when parsing metadata name
Merge branch 'GoogleCloudPlatform:main' into feature/iam_policy

Add ignore read on reserved ip ranges (GoogleCloudPlatform#7429)

Fix serviceusage links, clean up service resource stub (GoogleCloudPlatform#7435)

Remove use of `make generate` from TPG/TPGB-specific step in CI (GoogleCloudPlatform#7379)

Updating default accelerator.state field behavior in Data Fusion Instance (GoogleCloudPlatform#7434)

Making suggested default behavior functionality updates in previous accelerators PR.
Modify resource attribute 'input' to 'immutable' (GoogleCloudPlatform#7431)

* Modify resource attribute 'input' to 'immutable'
Remove noisy logging of project sweeper being skipped (GoogleCloudPlatform#7439)

Fix PubSub-to-BigQuery push configuration example (GoogleCloudPlatform#7410)

Rework + reflow provider reference, touch up index (GoogleCloudPlatform#7437)

Fix eventarc tests to use dedicated bootstrapped keys (GoogleCloudPlatform#7440)

Update docs for changing attribute `input` to `immutable` (GoogleCloudPlatform#7442)

Feat name constraints (GoogleCloudPlatform#7400)

Remove game_service_cluster_basic test (GoogleCloudPlatform#7443)

send friendly_name (GoogleCloudPlatform#7433)

* send friendly_name

* fixed validator failures

* update

* fix validator errors

---------

Co-authored-by: Edward Sun <sunedward@google.com>
Fix headline of google_iam_workload_identity_pool (GoogleCloudPlatform#7449)

Move IAM bootstrap to its own file, improve error messages (GoogleCloudPlatform#7424)

* Move IAM bootstrap to its own file, improve errors

Also bootstrap roles/cloudbuild.builds.builder for cloudbuild service
agent.

* Re-add BootstrapConfig (accidentally deleted)

* Fix wrong variable name

* Bootstrap the role previously hardcoded for pubsub

* Move error message back into bootstrap function

This will dedup the code that calls this function. It now returns a
boolean and sends the more useful error through t.Error.

* Bootstrap the permissions for pubsub service agent

* Bootstrap the role in the correct test

* Fix formatting
Changing name field on google_compute_disk for TestAccComputeInstanceTemplate_sourceSnapshotEncryptionKey to include randomly generated string (GoogleCloudPlatform#7392)

* Changed name within google_compute_disk  on line 3162 to inclue and randomly generated string

* Cleaned up arguments being passed in to be more inline with other tests

* Updated based on addtional PR comments

* Fixed swapping of values within new context
If not specified, a default Workstations service agent SA is returned (GoogleCloudPlatform#7428)

* If not specified, a default service agent SA is returned

* Revert "Skip TestAccWorkstationsWorkstationConfig_workstationConfigEncryptionKeyExample"

This reverts commit 097bdbe.

* remove `rotation_period`
update BigqueryDatapolicy to ga (GoogleCloudPlatform#6797)

fix managed.dnsAuthorizations: (GoogleCloudPlatform#7445)

Co-authored-by: Edward Sun <sunedward@google.com>
google_compute_security_policy: force send enforce_on_key so it can be unset on (GoogleCloudPlatform#7454)

Make `hostname` and `matcher` fields immutable (GoogleCloudPlatform#7448)

Add note on requiredness (GoogleCloudPlatform#7453)

Update BootstrapProject to support use across multiple projects/environments (GoogleCloudPlatform#7369)

* Update BootstrapProject to support use across multiple projects/environments

* Fix typo

* Fix arguments for getTestProjectFromEnv

* Fix project naming strategy for BootstrapProject to produce valid names in all envs

* Fix typo

* Fix function name after rebase
Update resource names in acceptance test to use `tf-test-` prefix (GoogleCloudPlatform#7450)

fix datastream_stream dataset id import (GoogleCloudPlatform#7451)

Merge branch 'GoogleCloudPlatform:main' into feature/iam_policy

Removing api.yaml and replacing with per product configs

Merge branch 'feature/iam_policy' of https://github.com/dbjnbnrj/magic-modules into feature/iam_policy
  • Loading branch information
dbjnbnrj committed Mar 15, 2023
1 parent b53aaca commit 9d60ee1
Show file tree
Hide file tree
Showing 625 changed files with 64,668 additions and 57,765 deletions.
4 changes: 0 additions & 4 deletions .ci/containers/downstream-builder/generate_downstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@ popd

pushd $LOCAL_PATH

if [ "$REPO" == "terraform" ]; then
make generate
fi

git config --local user.name "Modular Magician"
git config --local user.email "magic-modules@google.com"
git add .
Expand Down
39 changes: 24 additions & 15 deletions .ci/gcb-generate-diffs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,27 @@ availableSecrets:
secretManager:
- versionName: projects/673497134629/secrets/github-magician-token/versions/latest
env: GITHUB_TOKEN
inline:
- kmsKeyName: projects/graphite-docker-images/locations/global/keyRings/environment-keyring/cryptoKeys/ci-project-key
envMap:
GOOGLE_BILLING_ACCOUNT: CiQAis6xrGyvnmGipEEjCQVUzu3o1H4XRJSsp/B8A0IFqwRwnogSPQDOc1nLdG/+VCWpKtYtbEl12+luWkHmOYn/VtkDuMkz3bCj2DNbcuLw2fgvmkha1IjnouGPIah0qLkDmTU=
GOOGLE_CUST_ID: CiQAis6xrAfbX3gtctcnZnt8n5DDZjercDObUGlyN4CqIpWKu5kSMgDOc1nLhLObfpnlhaUxdZ6Aoo38TBtRXoXAW5W4dbdyP+8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wQlQKg4GVgDK60P7fSvpuv1H9ozfPg0K9loI+utG9QYZNQ0RJ8heGnB30lcGPwUXJg2FRsAqzk29pg+PP7hwYfoVi7/8pD5i+1b2iVR2NaYUdJA/2z7v0pGxPGWtpIVYYZ4xVaTFXj6wUefjTHYq/SZZwHphP1iUpFyL7HfB52KOjohyrYEIpeT1eh+l7jot9aMshIXDOicpVIQiiDpHxZtP3gTrcWXpLUc/QSQIFIaUZioe0D9oIIfXrgo3N7WI01vy73q0DebasnBfDUk96aql11ZWeCQ4F4Yy3gOZJiJs7dmQ4BXoaTNNiFi64gzefSHQPlPBLgotGIhGBcT0xucjSye+UwVVfUiSyvPCeFYLqncp3nM2A+1fLl3Ej42Pr/+3eVFGgyf1LBhDaC9mr+4E04HQadwfjD65dnLNr4=
- versionName: projects/673497134629/secrets/ci-test-billing-account/versions/latest
env: GOOGLE_BILLING_ACCOUNT
- versionName: projects/673497134629/secrets/ci-test-cust-id/versions/latest
env: GOOGLE_CUST_ID
- versionName: projects/673497134629/secrets/ci-test-firestore-project/versions/latest
env: GOOGLE_FIRESTORE_PROJECT
- versionName: projects/673497134629/secrets/ci-test-identity-user/versions/latest
env: GOOGLE_IDENTITY_USER
- versionName: projects/673497134629/secrets/ci-test-master-billing-account/versions/latest
env: GOOGLE_MASTER_BILLING_ACCOUNT
- versionName: projects/673497134629/secrets/ci-test-org/versions/latest
env: GOOGLE_ORG
- versionName: projects/673497134629/secrets/ci-test-org-2/versions/latest
env: GOOGLE_ORG_2
- versionName: projects/673497134629/secrets/ci-test-org-domain/versions/latest
env: GOOGLE_ORG_DOMAIN
- versionName: projects/673497134629/secrets/ci-test-project/versions/latest
env: GOOGLE_PROJECT
- versionName: projects/673497134629/secrets/ci-test-project-number/versions/latest
env: GOOGLE_PROJECT_NUMBER
- versionName: projects/673497134629/secrets/ci-test-service-account/versions/latest
env: GOOGLE_SERVICE_ACCOUNT
- versionName: projects/673497134629/secrets/ci-test-service-account-key/versions/latest
env: SA_KEY
7 changes: 2 additions & 5 deletions .ci/gcb-push-downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,5 @@ availableSecrets:
secretManager:
- versionName: projects/673497134629/secrets/github-magician-token/versions/latest
env: GITHUB_TOKEN
inline:
# This is the ciphertext of the token, encrypted using the above KMS key.
- kmsKeyName: projects/graphite-docker-images/locations/global/keyRings/environment-keyring/cryptoKeys/ci-project-key
envMap:
GOOGLE_PROJECT: CiQAis6xrDDU4Wcxn5s8Y790IMxTUEe2d3SaYEXUGScHfaLjOw8SPwDOc1nLe6Yz0zzA0mcYTsXaeGSFYu7uQ5+QCtTProJWRv2ITrNwCS3AF/kvMCrHvltx7O1CZnJveutlVpZH3w==
- versionName: projects/673497134629/secrets/ci-test-project/versions/latest
env: GOOGLE_PROJECT
6 changes: 5 additions & 1 deletion docs/content/docs/how-to/add-mmv1-iam.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ annotation can be used. To use it, partially define the resource in the
product's `api.yaml` file and apply the annotation. MMv1 won't attempt to
generate the resource itself and will only generate IAM resources targeting it.

The IAP product is a good reference for adding these: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products/iap
For tpgtools/DCL resources, you may need to set the `PRODUCT_BASE_PATH` override
to ensure that MMv1 is the sole library trying to set the base product URL.

The IAP product is a good reference for adding IAM support to nonexistent resources:
https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products/iap
4 changes: 2 additions & 2 deletions docs/content/docs/how-to/add-mmv1-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ as the following adding support for a `fooBar` field in the API:
- !ruby/object:Api::Type::String
name: 'fooBar'
min_version: beta
input: true
immutable: true
description: |
The cloud.google.com description of this field.
```
Expand All @@ -59,7 +59,7 @@ setting values to `false`, and omit them instead.
* `required: true` indicates that a field is required. New top-level fields
should not be considered required, as that is a breaking change. Subfields
of newly-added optional fields can be added as required.
* `input: true` indicates that a field can only be set when the API resource is
* `immutable: true` indicates that a field can only be set when the API resource is
created. Changing the field will force the resource to be recreated.
* `output: true` indicates that a field is output-only in the API and cannot
be configured by the user.
Expand Down
4 changes: 2 additions & 2 deletions mmv1/api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Properties
# [Optional] If set to true, don't generate the resource.
attr_reader :exclude
# [Optional] If set to true, the resource is not able to be updated.
attr_reader :input
attr_reader :immutable
# [Optional] If set to true, this resource uses an update mask to perform
# updates. This is typical of newer GCP APIs.
attr_reader :update_mask
Expand Down Expand Up @@ -244,7 +244,7 @@ def validate
check :delete_verb, type: Symbol, default: :DELETE, allowed: %i[POST PUT PATCH DELETE]
check :update_verb, type: Symbol, default: :PUT, allowed: %i[POST PUT PATCH]

check :input, type: :boolean
check :immutable, type: :boolean
check :min_version, type: String

check :has_self_link, type: :boolean, default: false
Expand Down
4 changes: 2 additions & 2 deletions mmv1/api/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module Fields
attr_reader :removed_message

attr_reader :output # If set value will not be sent to server on sync
attr_reader :input # If set to true value is used only on creation
attr_reader :immutable # If set to true value is used only on creation

# url_param_only will not send the field in the resource body and will
# not attempt to read the field from the API response.
Expand Down Expand Up @@ -214,7 +214,7 @@ def validate
check :allow_empty_object, type: :boolean
check :url_param_only, type: :boolean
check :read_query_params, type: ::String
check :input, type: :boolean
check :immutable, type: :boolean

raise 'Property cannot be output and required at the same time.' \
if @output && @required
Expand Down
34 changes: 25 additions & 9 deletions mmv1/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,40 @@
resources = []
Dir["#{product_name}/*"].each do |file_path|
next if File.basename(file_path) == 'product.yaml' \
|| File.basename(file_path) == 'terraform.yaml'
|| File.basename(file_path) == 'terraform.yaml' \
|| File.extname(file_path) != '.yaml'

if override_dir
# Skip if resource will be merged in the override loop
resource_override_path = File.join(override_dir, file_path)
res_yaml = if File.exist?(resource_override_path)
next if File.exist?(resource_override_path)
end
res_yaml = File.read(file_path)
resource = Api::Compiler.new(res_yaml).run
resource.validate
resources.push(resource)
end

if override_dir
ovr_prod_dir = File.join(override_dir, product_name)
Dir["#{ovr_prod_dir}/*"].each do |override_path|
next if File.basename(override_path) == 'product.yaml' \
|| File.basename(override_path) == 'terraform.yaml' \
|| File.extname(override_path) != '.yaml'

file_path = File.join(product_name, File.basename(override_path))
res_yaml = if File.exist?(file_path)
YAML.load_file(file_path, permitted_classes: allowed_classes) \
.merge(YAML \
.load_file(resource_override_path, permitted_classes: allowed_classes)) \
.load_file(override_path, permitted_classes: allowed_classes)) \
.to_yaml
else
File.read(file_path)
File.read(override_path)
end
else
res_yaml = File.read(file_path)
resource = Api::Compiler.new(res_yaml).run
resource.validate
resources.push(resource)
end
resource = Api::Compiler.new(res_yaml).run
resource.validate
resources.push(resource)
end
product_api.set_variable(resources, 'objects')
end
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accessapproval/FolderSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: |
ID of the folder of the access approval settings.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accessapproval/OrganizationSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: |
ID of the organization of the access approval settings.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accessapproval/ProjectSettings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description: |
ID of the project of the access approval settings.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/AccessLevel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
The AccessPolicy this AccessLevel lives in.
Format: accessPolicies/{policy_id}
ignore_read: true
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the Access Level. The short_name component must begin
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/AccessLevelCondition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
self_link: "{{access_level}}"
create_verb: :PATCH
delete_verb: :PATCH
input: true
immutable: true
update_mask: true
identity:
- ipSubnetworks
Expand Down Expand Up @@ -82,7 +82,7 @@
description: |
The name of the Access Level to add this condition to.
required: true
input: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::Array
Expand Down
4 changes: 2 additions & 2 deletions mmv1/products/accesscontextmanager/AccessLevels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# This must be done at the provider level.
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
url_param_only: true
description: |
Expand All @@ -63,7 +63,7 @@
properties:
- !ruby/object:Api::Type::String
name: name
input: true
immutable: true
required: true
description: |
Resource name for the Access Level. The short_name component must begin
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/accesscontextmanager/AccessPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
parameters:
- !ruby/object:Api::Type::String
name: parent
input: true
immutable: true
required: true
description: |
The parent of this AccessPolicy in the Cloud Resource Hierarchy.
Expand Down
Loading

0 comments on commit 9d60ee1

Please sign in to comment.