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

update magic module-generated resources with at_least_one_of #2639

Merged

Conversation

megan07
Copy link
Contributor

@megan07 megan07 commented Nov 10, 2019

One known bug I need to still work on (and this actually probably refers back to the other PR #2608 - but I just wanted to make a note of it here) is that, with the hand-written at least one of check is implemented on typeLists, if one of the fields is computed, it will fail as diff.Get == "". I'm currently looking into that and will correct that in a future (but related) PR.

Also, as I was reading over all of this and creating the release notes, I started wondering if the required and at_least_one_of fields should be in api.yaml or terraform.yaml. Any thoughts?

The change to version_3_upgrade.html.markdown is not from this PR, but the previous one. I will need to go through and update all documentation still to represent what has been done in all PRs relating to this at the end. That PR is still to come.

Release Note Template for Downstream PRs (will be copied)

`accesscontextmanager`: Made at least one of `resources`, `access_levels`, or `restricted_services` required on `google_accesscontextmanager_service_perimeter.status`.
`app_engine`: Made at least one of `zip`, or `files` is now required on `google_app_engine_standard_app_version.deployment`.
`cloudscheduler`: Made at least one of `retry_count`, `max_retry_duration`, `min_backoff_duration`, `max_backoff_duration`, or `max_doublings` required on `google_cloud_scheduler_job.retry_config`.
`cloudscheduler`: Made at least one of `service`, `version`,  or `instance` required on `google_cloud_scheduler_job.app_engine_http_target.app_engine_routing`.
`compute`: Made `signed_url_cache_max_age_sec` required on `google_compute_backend_bucket.autoscaling_policy.cdn_policy`.
`compute`: Made at least one of `connect_timeout`, `max_requests_per_connection`, `max_connections`, `max_pending_requests`, `max_requests`,  or `max_retries` required on `google_compute_backend_service.circuit_breakers`.
`compute`: Made at least one of `ttl`, `name`, or `path` required on `google_compute_backend_service.consistent_hash.http_cookie`.
`compute`: Made at least one of `http_cookie`, `http_header_name`, or `minimum_ring_size` required on `google_compute_backend_service.consistent_hash`.
`compute`: Made at least one of `cache_key_policy` or `signed_url_cache_max_age_sec` required on `google_compute_backend_service.cdn_policy`.
`compute`: Made at least one of `include_host`, `include_protocol`, `include_query_string`, `query_string_blacklist`, or `query_string_whitelist` required on `google_compute_backend_service.cdn_policy.cache_key_policy`.
`compute`: Made at least one of `base_ejection_time`, `consecutive_errors`, `consecutive_gateway_failure`, `enforcing_consecutive_errors`, `enforcing_consecutive_gateway_failure`, `enforcing_success_rate`, `interval`, `max_ejection_percent`, `success_rate_minimum_hosts`, `success_rate_request_volume`, or `success_rate_stdev_factor` required on `google_compute_backend_service.outlier_detection`.
`compute`: Made at least one of `enable` or `sample_rate` required on `google_compute_backend_service.log_config`.
`compute`: Made at least one of `connect_timeout`, `max_requests_per_connection`, `max_connections`, `max_pending_requests`, `max_requests`,  or `max_retries` required on `google_compute_region_backend_service.circuit_breakers`.
`compute`: Made at least one of `ttl`, `name`, or `path` required on `google_compute_region_backend_service.consistent_hash.http_cookie`.
`compute` Made at least one of `http_cookie`, `http_header_name`, or `minimum_ring_size` required on `google_compute_region_backend_service.consistent_hash`.
`compute`: Made at least one of `disable_connection_drain_on_failover`, `drop_traffic_if_unhealthy`, or `failover_ratio` required on `google_compute_region_backend_service.failover_policy`.
`compute`: Made at least one of `base_ejection_time`, `consecutive_errors`, `consecutive_gateway_failure`, `enforcing_consecutive_errors`, `enforcing_consecutive_gateway_failure`, `enforcing_success_rate`, `interval`, `max_ejection_percent`, `success_rate_minimum_hosts`, `success_rate_request_volume`, or `success_rate_stdev_factor` required on `google_compute_region_backend_service.outlier_detection`.
`compute`: Made at least one of `enable` or `sample_rate` required on `google_compute_region_backend_service.log_config`.
`compute`: Made at least one of `host`, `request_path`, `response`, `port`, `port_name`, `proxy_header`, or `port_specification` required on `google_compute_health_check.http_health_check`, `google_compute_health_check.https_health_check` and `google_compute_health_check.http2_health_check`.
`compute`: Made at least one of `request`, `response`, `port`, `port_name`, `proxy_header`, or `port_specification` required on `google_compute_health_check.ssl_health_check` and `google_compute_health_check.tcp_health_check`.
`compute`: Made at least one of `cpus` or `memory` required on `google_compute_node_template.node_type_flexibility`.
`compute`: Made `type` required on `google_compute_image.guest_os_features`.
`compute`: Made at least one of `host`, `request_path`, `response`, `port`, `port_name`, `proxy_header`, or `port_specification` required on `google_compute_region_health_check.http_health_check`, `google_compute_region_health_check.https_health_check` and `google_compute_region_health_check.http2_health_check`.
`compute`: Made at least one of `request`, `response`, `port`, `port_name`, `proxy_header`, or `port_specification` required on `google_compute_region_health_check.ssl_health_check` and `google_compute_region_health_check.tcp_health_check`.
`compute`: Made at least one of `labels`, `storage_locations`, or `guest_flush` required on `google_compute_resource_policy.snapshot_schedule_policy.snapshot_properties`.
`compute`: Made `range` required on `google_compute_router.bgp.advertised_ip_ranges`.
`compute`: Made at least one of `aggregation_interval`, `flow_sampling`, or `metadata` required on `google_compute_subnetwork.log_config`.
`dataproc`: Made at least one of `min_instances`, `max_instances`, or `weight` required on `google_dataproc_autoscaling_policy.secondary_worker_config`.
`dns`: Made at least one of `kind`, `non_existence`, `state`,  or `default_key_specs` required on `google_dns_managed_zone.dnssec_config`.
`dns`: Made `target_name_servers` required on `google_dns_managed_zone.forwarding_config`.
`dns`: Made `ipv4_address` required on `google_dns_managed_zone.forwarding_config.target_name_servers`.
`dns`: Made `target_network` required on `google_dns_managed_zone.peering_config`.
`dns`: Made `network_url` required on `google_dns_managed_zone.peering_config.target_network`.
`dns`: Made `target_name_servers` required on `google_dns_policy.alternative_name_server_config`.
`dns`: Made `ipv4_address` required on `google_dns_policy.alternative_name_server_config.target_name_servers`.
`healthcare`: Made at least one of `allow_null_header ` or `segment_terminator` required on `google_healthcare_hl7_v2_store.parser_config`.
`logging`: Made at least one of `linear_buckets`, `exponential_buckets` or `explicit_buckets` required on `google_logging_metric.bucket_options`.
`logging`: Made at least one of `num_finite_buckets`, `width` or `offset` required on `google_logging_metric.bucket_options.linear_buckets`.
`logging`: Made at least one of `num_finite_buckets`, `growth_factor` or `scale` required on `google_logging_metric.bucket_options.exponential_buckets`.
`logging`: Made `bounds` required on `google_logging_metric.bucket_options.explicit_buckets`.
`mlengine`: Made `name` required on `google_mlengine_model.default_version`.
`monitoring`: Made at least one of `content` or `mime_type` required on `google_monitoring_alert_policy.documentation`.
`monitoring`: Made `username` and `password` required on `google_monitoring_uptime_check_config.http_check.auth_info`.
`monitoring`: Made at least one of `resource_type` or `group_id` required on `google_monitoring_uptime_check_config.resource_group`.
`pubsub`: Made `ttl` required on `google_pubsub_subscription.expiration_policy`.
`securityscanner`: Made at least one of `google_account` or `custom_account` required on `google_securitiy_scanner_scan_config.authentication`.
`tpu`: Made `preemptible` required on `google_tpu_node.scheduling_config`.

@modular-magician
Copy link
Collaborator

3.0.0 diff report as of 281b8fbbe8224f1fe8282045adb9654665adedb9

TPG Diff
TPGB Diff
Mapper Diff

@modular-magician
Copy link
Collaborator

3.0.0 diff report as of 6eb5f7ae10f53199c8662bea57badebfe4918495

TPG Diff
TPGB Diff
Mapper Diff

@modular-magician
Copy link
Collaborator

3.0.0 diff report as of 21f3042dcddc3ee48f218d283674462853fc2460

TPG Diff
TPGB Diff
Mapper Diff

@@ -238,6 +238,7 @@ objects:
properties:
- !ruby/object:Api::Type::String
name: 'ttl'
required: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the docs, instead of if ttl is not set can you say if ttl is set to "", since not setting it is no longer a possibility?

@megan07 megan07 force-pushed the megan_nested_objects_atleastoneof branch from 21f3042 to b974288 Compare November 11, 2019 22:27
@modular-magician
Copy link
Collaborator

3.0.0 diff report as of b974288

TPG Diff
TPGB Diff
Mapper Diff

@megan07 megan07 merged commit a4bc788 into GoogleCloudPlatform:3.0.0 Nov 11, 2019
rileykarson added a commit that referenced this pull request Nov 13, 2019
* cloudbuild build trigger's trigger template should be required in 3.0.0. (#2352)

* cloudbuild build trigger's trigger template should be required in 3.0.0.

* Make backend_service.backends.group required. (#2373)

* Remove Removed fields (#2391)

* deprecated-->removed event notification config (#2390)

* deprecated-->removed event notification config

* remove singular config from tests/docs

* pluralize

* Update third_party/terraform/tests/resource_cloudiot_registry_test.go

Co-Authored-By: Riley Karson <[email protected]>

* Delete google_project_services in 3.0.0. (#2403)

* Changing IAM audit config to be authoritative (#2438)

* Changing IAM audit config to be authoritative

* Remove unused code + test

* Removing deprecated fields (#2436)

* Add validation for scratch disks in Instance Template (#2282)

* Add validation for scratch disks

* Remove source from scratch disk

* Use hardcoded image

* Add reverse logic

* Change default id format from {{name}} to self_link_uri (#2461)

* Change default id format from {{name}} to self_link_uri

* Updates to generated id formats (#2460)

* Update ID fields for various MM-generated resources

* gofmt -s -w extra file

* Add userinfo.email to default scopes (#2473)

* Set GKE Stackdriver defaults to GKE Stackdriver Monitoring (#2471)

* only allow instance templates with 375gb scratch disks (#2495)

* Update cloudfunction id for 3.0.0 release (#2501)

* handle cloudfunctions deprecating nodejs6 (#2499)

* Handwritten id updates for several compute resources (#2502)

* Composer environment and compute attached disk id updates

* Add compute instance

* Add instance_from_group and instance_group

* IGM id

* Instance template tests passing

* Add new id format to other calls of parseImportId in IGM

* Small refactor to memoize var

* Refactor, remove parseImportId in IGM

* handle legacy network deprecation (#2508)

* Fix gofmt diff in Cloud Functions (#2542)

* More handwritten ids (#2527)

* Fix cloudfunction formatting, migrate RIGM id

* Update security policy resource id

* Update target pool id format

* Add new id for container cluster

* Node pool id updates

* PR feedback, using parseImportId for container resources

* Formatting

* fix container cluster (#2550)

* Datasource id updates (#2544)

* Update datasources

* formatting

* Even more handwritten ids (#2540)

* Dataproc cluster, job, google project

* Update sql ssl cert, database instance ids

* Project id comparison include projects/

* remove kubernetes_dashboard from google_container_cluster (#2551)

* Add back encoder that always sends autoCreateSubnetworks (#2558)

* Allow defining empty taint, remove old DSF (#2537)

* Remove encoder, can be done as send_empty_value on autoCreateSubnetworks (#2559)

* deprecate 0.11 syntax in docs (datasources) (#2573)

* deprecate 0.11 syntax in docs (resources) (#2574)

* deprecate 0.11 syntax in docs (magic modules examples) (#2579)

* remove long name behavior for pubsub subscriptions, clean up cu… (#2561)

* remove long name behavior for pubsub subscriptions, clean up custom expanders

* fix build

* fix tests

* Fix merge conflict in rigm test

* Remove unused regexes from rigm (#2602)

* Fix missing paren + bad var in resourcepolicy datasource 3.0.0 (#2600)

* Test fixes based on integration tests, id formats + other easy fixes (#2605)

* Test fixes based on integration tests, id formats + other easy fixes

* Compute network id test update

* Fix region disk test id

* Update subnetwork to remove enable_flow_logs and depend on log_config instead (#2597)

* Test updates to not depend on id format. Also test fixes (#2609)

* Test updates to not depend on id format. Also test fixes

* Typo

* location -> region in node pool test

* Cluster test fixes (#2611)

* Fix container cluster tests, and signed url key, instance group

* Fix invalid accessor

* Update hand-written resources with `AtLeastOneOf` and `ExactlyOneOf` attributes (#2608)

* Rigm/igm field removals for 3.0.0 (#2595)

* Remove deprecated IGM fields for 3.0

* fix imports (#2619)

* Remove automatic subnetwork creation in GKE (#2615)

* Remove automatic subnetwork creation in GKE

* Update docs, add Computed

* More integration test fixes (#2617)

* Fix bigtable for real, scratch disk size, target pool checks

* Proxy test fixes

* CloudIOT registry set removed field to nil. Add specific id format for access context manager

* (r)igm imports for customdiff (#2623)

* (r)igm imports for customdiff

* Fix schema issues

* Fix IGM custom diff and reuse method between resources (#2624)

* Forwardingrule ip address (#2620)

add the validation function

* Remove unused sort import from rigm (#2625)

* add composer test fixes, backend bucket signed url key (#2631)

* Stop users from specifying bigquery-json in 3.0.0 (#2626)

* Send null logConfig if subnetwork is L7ILB (#2635)

* Send null logConfig if subnetwork is L7ILB

* Move subnet ilb check to only if logConfig unspecified

* deprecate 0.11 syntax in tests (datasources) (#2593)

* Make master_authorized_networks_config.cidr_blocks Optional in… (#2642)

* Make master_authorized_networks_config.cidr_blocks Optional in GKE

* Add note

* update magic module-generated resources with at_least_one_of (#2639)

* add exactly_one_of to magic modules

update comment

* Update Data Fusion Instance to conform with 3.0.0 id updates (#2649)

* Fix IAM doc id_format to new post 3.0.0 style

* Add note on id format changes (#2656)

* Add upgrade guide for subnetwork log_config (#2653)

* Add upgrade guide for subnetwork log_config

* Add examples for subnet logConfig update

* Wording on upgrade guide

* Add note on audit log config (#2658)

* Add misc entries to the upgrade guide (#2657)

* Add misc entries to the upgrade guide

* Remove extra space

* add info on scratch disk size and remove duplicate kms_key_self… (#2659)

* Add upgrade guide notes. (#2663)

* Add upgrade guide for forwarding rule validation (#2666)

* Convert old import formats (using non-/) to use /. (#2638)

* Convert old import formats (using non-/) to use /.

* Upgrade proofreading (#2668)

* Add upgrade note for IoT registry event_notification_configs (#2390) (#2651)

Merged PR #2651.

* sort upgrade guide; change wording in a few places

* Password is not actually required. (#2670)

* Add improved for_each non-module variant to project service upg… (#2671)

* Update bigtable import & tests to 3.0 (#2673)

* update upgrade guide (#2665)

* update formatting for upgrade doc (#2674)

* Add rigm to upgrade guide (#2667)

Update docs to be accurate for 3.0

* proofreading changes (#2676)

* Add back lost newlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants