Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
joycezhou47 committed Aug 29, 2022
2 parents ef12f2c + 38743f3 commit 1f578ff
Show file tree
Hide file tree
Showing 34 changed files with 836 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .ci/containers/contributor-checker/check-contributor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
# This is where you add people to the random-assignee rotation. This list
# might not equal the list of users who do not need to have an assigne.
# If you add people to this list, please also add them to the re-request review list above
ASSIGNEE=$(shuf -n 1 <(printf "c2thorn\nslevenick\nscottsuarez\nshuyama1\nmegan07\nmelinath"))
ASSIGNEE=$(shuf -n 1 <(printf "rileykarson\nc2thorn\nslevenick\nscottsuarez\nshuyama1\nmegan07\nmelinath"))
comment=$(cat << EOF
Hello! I am a robot who works on Magic Modules PRs.
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tpgtools/overrides @rileykarson
27 changes: 27 additions & 0 deletions mmv1/products/apigee/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ objects:
base_url: 'environments'
create_url: '{{org_id}}/environments'
self_link: '{{org_id}}/environments/{{name}}'
update_url: '{{org_id}}/environments/{{name}}'
update_verb: :PATCH
update_mask: true
async: !ruby/object:Api::OpAsync
operation: !ruby/object:Api::OpAsync::Operation
path: 'name'
Expand Down Expand Up @@ -294,6 +297,7 @@ objects:
description: |
The resource ID of the environment.
required: true
input: true
- !ruby/object:Api::Type::String
name: 'displayName'
description: |
Expand Down Expand Up @@ -331,6 +335,29 @@ objects:
- "PROGRAMMABLE"
- "CONFIGURABLE"
input: true
- !ruby/object:Api::Type::NestedObject
name: 'nodeConfig'
description: |
NodeConfig for setting the min/max number of nodes associated with the environment.
properties:
- !ruby/object:Api::Type::String
name: 'minNodeCount'
description: |
The minimum total number of gateway nodes that the is reserved for all instances that
has the specified environment. If not specified, the default is determined by the
recommended minimum number of nodes for that gateway.
- !ruby/object:Api::Type::String
name: 'maxNodeCount'
description: |
The maximum total number of gateway nodes that the is reserved for all instances that
has the specified environment. If not specified, the default is determined by the
recommended maximum number of nodes for that gateway.
- !ruby/object:Api::Type::String
name: 'currentAggregateNodeCount'
description: |
The current total number of gateway nodes that each environment currently has across
all instances.
output: true
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Creating an environment':
Expand Down
13 changes: 13 additions & 0 deletions mmv1/products/apigee/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,24 @@ overrides: !ruby/object:Overrides::ResourceOverrides
skip_docs: true
# Resource creation race
skip_vcr: true
- !ruby/object:Provider::Terraform::Examples
name: "apigee_environment_nodeconfig_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
skip_docs: true
min_version: beta
# Resource creation race
skip_vcr: true
properties:
deploymentType: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
apiProxyType: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
nodeConfig: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
timeouts: !ruby/object:Api::Timeouts
insert_minutes: 30
delete_minutes: 30
Expand Down
8 changes: 0 additions & 8 deletions mmv1/products/certificatemanager/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
overrides: !ruby/object:Overrides::ResourceOverrides
DnsAuthorization: !ruby/object:Overrides::Terraform::ResourceOverride
docs: !ruby/object:Provider::Terraform::Docs
warning: |
These resources require allow-listing to use, and are not openly available to all Cloud customers. Engage with your Cloud account team to discuss how to onboard.
autogen_async: true
import_format: ["projects/{{project}}/locations/global/dnsAuthorizations/{{name}}"]
examples:
Expand All @@ -28,8 +26,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
zone_name: "my-zone"
Certificate: !ruby/object:Overrides::Terraform::ResourceOverride
docs: !ruby/object:Provider::Terraform::Docs
warning: |
These resources require allow-listing to use, and are not openly available to all Cloud customers. Engage with your Cloud account team to discuss how to onboard.
autogen_async: true
import_format: ["projects/{{project}}/locations/global/certificates/{{name}}"]
examples:
Expand Down Expand Up @@ -59,8 +55,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
constants: templates/terraform/constants/cert_manager.erb
CertificateMap: !ruby/object:Overrides::Terraform::ResourceOverride
docs: !ruby/object:Provider::Terraform::Docs
warning: |
These resources require allow-listing to use, and are not openly available to all Cloud customers. Engage with your Cloud account team to discuss how to onboard.
autogen_async: true
import_format: ["projects/{{project}}/locations/global/certificateMaps/{{name}}"]
examples:
Expand All @@ -74,8 +68,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
default_from_api: true
CertificateMapEntry: !ruby/object:Overrides::Terraform::ResourceOverride
docs: !ruby/object:Provider::Terraform::Docs
warning: |
These resources require allow-listing to use, and are not openly available to all Cloud customers. Engage with your Cloud account team to discuss how to onboard.
autogen_async: true
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down
1 change: 0 additions & 1 deletion mmv1/products/cloudrun/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
scheduled_cloud_run_job: "scheduled-cloud-run-job"
test_env_vars:
project: :PROJECT_NAME
min_version: beta
skip_docs: true
- !ruby/object:Provider::Terraform::Examples
name: "cloud_run_service_secret_environment_variables"
Expand Down
11 changes: 10 additions & 1 deletion mmv1/products/dns/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ objects:
name: 'ResponsePolicy'
kind: 'dns#responsePolicy'
description: |
A Response Policy is a collection of selectors that apply to queries
A Response Policy is a collection of selectors that apply to queries
made against one or more Virtual Private Cloud networks.
base_url: 'projects/{{project}}/responsePolicies'
self_link: 'projects/{{project}}/responsePolicies/{{response_policy_name}}'
Expand Down Expand Up @@ -575,6 +575,8 @@ objects:
update_verb: :PATCH
- !ruby/object:Api::Type::NestedObject
name: 'localData'
conflicts:
- behavior
description: |
Answer this query directly with DNS data. These ResourceRecordSets override any other DNS behavior for the matched name;
in particular they override private zones, the public internet, and GCP internal DNS. No SOA nor NS types are allowed.
Expand Down Expand Up @@ -625,3 +627,10 @@ objects:
name: 'rrdatas'
description: |
As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1)
- !ruby/object:Api::Type::String
name: 'behavior'
conflicts:
- local_data
min_version: beta
description: Answer this query with a behavior rather than DNS data. Acceptable values are 'behaviorUnspecified', and 'bypassResponsePolicy'
update_verb: :PATCH
12 changes: 12 additions & 0 deletions mmv1/products/monitoring/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
NotificationChannel: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{name}}"
import_format: ["{{name}}"]
delete_url: 'v3/{{name}}?force={{force_delete}}'
mutex: stackdriver/notifications/{{project}}
error_retry_predicates: ["isMonitoringConcurrentEditError"]
examples:
Expand All @@ -78,6 +79,17 @@ overrides: !ruby/object:Overrides::ResourceOverrides
skip_test: true
vars:
display_name: "Sensitive Notification Channel test"
virtual_fields:
- !ruby/object:Api::Type::Boolean
name: 'force_delete'
url_param_only: true
default_value: false
description: |
If true, the notification channel will be deleted regardless
of its use in alert policies (the policies will be updated
to remove the channel). If false, channels that are still
referenced by an existing alerting policy will fail to be
deleted in a delete operation.
custom_code: !ruby/object:Provider::Terraform::CustomCode
resource_definition: templates/terraform/resource_definition/monitoring_notification_channel.erb
encoder: templates/terraform/encoders/monitoring_notification_channel.go.erb
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
resource "google_project" "project" {
provider = google-beta

project_id = "tf-test%{random_suffix}"
name = "tf-test%{random_suffix}"
org_id = "<%= ctx[:test_env_vars]['org_id'] %>"
billing_account = "<%= ctx[:test_env_vars]['billing_account'] %>"
}

resource "google_project_service" "apigee" {
provider = google-beta

project = google_project.project.project_id
service = "apigee.googleapis.com"
}

resource "google_project_service" "compute" {
provider = google-beta

project = google_project.project.project_id
service = "compute.googleapis.com"
}

resource "google_project_service" "servicenetworking" {
provider = google-beta

project = google_project.project.project_id
service = "servicenetworking.googleapis.com"
}

resource "google_project_service" "kms" {
provider = google-beta

project = google_project.project.project_id
service = "cloudkms.googleapis.com"
}

resource "google_compute_network" "apigee_network" {
provider = google-beta

name = "apigee-network"
project = google_project.project.project_id
depends_on = [google_project_service.compute]
}

resource "google_compute_global_address" "apigee_range" {
provider = google-beta

name = "apigee-range"
purpose = "VPC_PEERING"
address_type = "INTERNAL"
prefix_length = 16
network = google_compute_network.apigee_network.id
project = google_project.project.project_id
}

resource "google_service_networking_connection" "apigee_vpc_connection" {
provider = google-beta

network = google_compute_network.apigee_network.id
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = [google_compute_global_address.apigee_range.name]
depends_on = [google_project_service.servicenetworking]
}

resource "google_kms_key_ring" "apigee_keyring" {
provider = google-beta

name = "apigee-keyring"
location = "us-central1"
project = google_project.project.project_id
depends_on = [google_project_service.kms]
}

resource "google_kms_crypto_key" "apigee_key" {
provider = google-beta

name = "apigee-key"
key_ring = google_kms_key_ring.apigee_keyring.id
}

resource "google_project_service_identity" "apigee_sa" {
provider = google-beta

project = google_project.project.project_id
service = google_project_service.apigee.service
}

resource "google_kms_crypto_key_iam_binding" "apigee_sa_keyuser" {
provider = google-beta

crypto_key_id = google_kms_crypto_key.apigee_key.id
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"

members = [
"serviceAccount:${google_project_service_identity.apigee_sa.email}",
]
}

resource "google_apigee_organization" "apigee_org" {
provider = google-beta

analytics_region = "us-central1"
project_id = google_project.project.project_id
authorized_network = google_compute_network.apigee_network.id
billing_type = "PAYG"
runtime_database_encryption_key_name = google_kms_crypto_key.apigee_key.id

depends_on = [
google_service_networking_connection.apigee_vpc_connection,
google_project_service.apigee,
google_kms_crypto_key_iam_binding.apigee_sa_keyuser,
]
}

resource "google_apigee_environment" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

org_id = google_apigee_organization.apigee_org.id
name = "tf-test%{random_suffix}"
description = "Apigee Environment"
display_name = "tf-test%{random_suffix}"
node_config {
min_node_count = "3"
max_node_count = "5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ resource "google_healthcare_fhir_store" "default" {
}

notification_configs {
pubsubTopic = "gs://${google_pubsub_topic.topic.name}"
sendFullResource = true
pubsub_topic = "gs://${google_pubsub_topic.topic.name}"
send_full_resource = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ resource "google_monitoring_notification_channel" "<%= ctx[:primary_resource_id]
labels = {
email_address = "[email protected]"
}
force_delete = false
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# [START storage_create_lifecycle_setting_tf]
resource "google_storage_bucket" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
name = "<%= ctx[:vars]['example_bucket'] %>"
location = "US"
uniform_bucket_level_access = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,6 @@ func dataSourceGoogleComputeInstanceRead(d *schema.ResourceData, meta interface{
if err := d.Set("name", instance.Name); err != nil {
return fmt.Errorf("Error setting name: %s", err)
}
d.SetId(fmt.Sprintf("projects/%s/zones/%s/instances/%s", project, instance.Zone, instance.Name))
d.SetId(fmt.Sprintf("projects/%s/zones/%s/instances/%s", project, GetResourceNameFromSelfLink(instance.Zone), instance.Name))
return nil
}
Loading

0 comments on commit 1f578ff

Please sign in to comment.