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

TPG 3.0.0 #2470

Merged
merged 73 commits into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
944f067
cloudbuild build trigger's trigger template should be required in 3.0…
nat-henderson Sep 24, 2019
dddf2b3
Make backend_service.backends.group required. (#2373)
nat-henderson Sep 25, 2019
0a27c9c
Remove Removed fields (#2391)
megan07 Sep 27, 2019
f62ad50
deprecated-->removed event notification config (#2390)
emilymye Sep 27, 2019
9be7db0
Delete google_project_services in 3.0.0. (#2403)
nat-henderson Oct 2, 2019
6326cc0
Changing IAM audit config to be authoritative (#2438)
slevenick Oct 7, 2019
227daf3
Removing deprecated fields (#2436)
megan07 Oct 8, 2019
aec98d6
Add validation for scratch disks in Instance Template (#2282)
rileykarson Oct 9, 2019
99311c6
Change default id format from {{name}} to self_link_uri (#2461)
slevenick Oct 11, 2019
e414c84
Updates to generated id formats (#2460)
slevenick Oct 14, 2019
47dcf6a
gofmt -s -w extra file
rileykarson Oct 15, 2019
6b79dc2
Add userinfo.email to default scopes (#2473)
rileykarson Oct 15, 2019
c56714b
Set GKE Stackdriver defaults to GKE Stackdriver Monitoring (#2471)
rileykarson Oct 16, 2019
c0da2c3
only allow instance templates with 375gb scratch disks (#2495)
danawillow Oct 21, 2019
18dd2b8
Update cloudfunction id for 3.0.0 release (#2501)
slevenick Oct 21, 2019
eb24be7
handle cloudfunctions deprecating nodejs6 (#2499)
megan07 Oct 22, 2019
f84deb6
Handwritten id updates for several compute resources (#2502)
slevenick Oct 23, 2019
8b96785
handle legacy network deprecation (#2508)
megan07 Oct 24, 2019
964a1c1
Fix gofmt diff in Cloud Functions (#2542)
rileykarson Oct 25, 2019
1e33f6e
More handwritten ids (#2527)
slevenick Oct 25, 2019
f17163a
fix container cluster (#2550)
megan07 Oct 28, 2019
afa3db8
Datasource id updates (#2544)
slevenick Oct 28, 2019
246b383
Even more handwritten ids (#2540)
slevenick Oct 28, 2019
a330af8
remove kubernetes_dashboard from google_container_cluster (#2551)
megan07 Oct 29, 2019
90b60e7
Add back encoder that always sends autoCreateSubnetworks (#2558)
slevenick Oct 29, 2019
4b48045
Allow defining empty taint, remove old DSF (#2537)
rileykarson Oct 29, 2019
f159dd2
Remove encoder, can be done as send_empty_value on autoCreateSubnetwo…
slevenick Oct 29, 2019
e5a61ec
deprecate 0.11 syntax in docs (datasources) (#2573)
megan07 Nov 1, 2019
5984dd0
deprecate 0.11 syntax in docs (resources) (#2574)
megan07 Nov 1, 2019
4ab9623
deprecate 0.11 syntax in docs (magic modules examples) (#2579)
megan07 Nov 4, 2019
5bc6852
remove long name behavior for pubsub subscriptions, clean up cu… (#2561)
danawillow Nov 5, 2019
b270a37
Fix merge conflict in rigm test
rileykarson Nov 6, 2019
1cb3ea5
Remove unused regexes from rigm (#2602)
slevenick Nov 6, 2019
ef54f58
Fix missing paren + bad var in resourcepolicy datasource 3.0.0 (#2600)
rileykarson Nov 6, 2019
36258de
Test fixes based on integration tests, id formats + other easy fixes …
slevenick Nov 7, 2019
3910f5c
Update subnetwork to remove enable_flow_logs and depend on log_config…
slevenick Nov 7, 2019
ea2b36b
Test updates to not depend on id format. Also test fixes (#2609)
slevenick Nov 7, 2019
2f23b61
Cluster test fixes (#2611)
slevenick Nov 7, 2019
1a5847a
Update hand-written resources with `AtLeastOneOf` and `ExactlyOneOf` …
megan07 Nov 7, 2019
ebbe141
Rigm/igm field removals for 3.0.0 (#2595)
chrisst Nov 7, 2019
599d1d0
fix imports (#2619)
chrisst Nov 8, 2019
6228d25
Remove automatic subnetwork creation in GKE (#2615)
rileykarson Nov 8, 2019
4152e82
More integration test fixes (#2617)
slevenick Nov 8, 2019
4c77a9c
(r)igm imports for customdiff (#2623)
slevenick Nov 8, 2019
503be4f
Fix IGM custom diff and reuse method between resources (#2624)
chrisst Nov 8, 2019
b610139
Forwardingrule ip address (#2620)
chrisst Nov 8, 2019
618d645
Remove unused sort import from rigm (#2625)
rileykarson Nov 8, 2019
732299c
add composer test fixes, backend bucket signed url key (#2631)
slevenick Nov 8, 2019
5081dbe
Stop users from specifying bigquery-json in 3.0.0 (#2626)
rileykarson Nov 8, 2019
978b430
Send null logConfig if subnetwork is L7ILB (#2635)
slevenick Nov 9, 2019
0630ff3
deprecate 0.11 syntax in tests (datasources) (#2593)
megan07 Nov 10, 2019
a6227da
Make master_authorized_networks_config.cidr_blocks Optional in… (#2642)
rileykarson Nov 11, 2019
225f27d
update magic module-generated resources with at_least_one_of (#2639)
megan07 Nov 11, 2019
f0757f4
Update Data Fusion Instance to conform with 3.0.0 id updates (#2649)
c2thorn Nov 12, 2019
b283cf4
Fix IAM doc id_format to new post 3.0.0 style
slevenick Nov 12, 2019
394a128
add exactly_one_of to magic modules
megan07 Nov 11, 2019
a74822d
Add note on id format changes (#2656)
slevenick Nov 12, 2019
50ed60b
Add upgrade guide for subnetwork log_config (#2653)
slevenick Nov 12, 2019
39397b2
Add note on audit log config (#2658)
slevenick Nov 12, 2019
68dff48
Add misc entries to the upgrade guide (#2657)
rileykarson Nov 12, 2019
24d5dfb
add info on scratch disk size and remove duplicate kms_key_self… (#2659)
danawillow Nov 12, 2019
1f85129
Add upgrade guide notes. (#2663)
paddycarver Nov 12, 2019
9ee652e
Add upgrade guide for forwarding rule validation (#2666)
emilymye Nov 13, 2019
9381806
Convert old import formats (using non-/) to use /. (#2638)
nat-henderson Nov 13, 2019
2136b06
Upgrade proofreading (#2668)
danawillow Nov 13, 2019
2843f2b
Password is not actually required. (#2670)
paddycarver Nov 13, 2019
c7756ac
Add improved for_each non-module variant to project service upg… (#2671)
rileykarson Nov 13, 2019
176cdff
Update bigtable import & tests to 3.0 (#2673)
slevenick Nov 13, 2019
7a51a89
update upgrade guide (#2665)
megan07 Nov 13, 2019
fb040de
update formatting for upgrade doc (#2674)
megan07 Nov 13, 2019
26cf915
Add rigm to upgrade guide (#2667)
chrisst Nov 13, 2019
4797f26
proofreading changes (#2676)
megan07 Nov 13, 2019
cae5354
Add back lost newlines
rileykarson Nov 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 46 additions & 0 deletions api/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ module Fields
# A list of properties that conflict with this property.
attr_reader :conflicts

# A list of properties that at least one of must be set.
attr_reader :at_least_one_of

# A list of properties that exactly one of must be set.
attr_reader :exactly_one_of

# Can only be overridden - we should never set this ourselves.
attr_reader :new_type

Expand Down Expand Up @@ -109,6 +115,8 @@ def validate

check_default_value_property
check_conflicts
check_at_least_one_of
check_exactly_one_of
end

def to_s
Expand All @@ -135,6 +143,10 @@ def to_json(opts = nil)
instance_variables.each do |v|
if v == :@conflicts && instance_variable_get(v).empty?
# ignore empty conflict arrays
elsif v == :@at_least_one_of && instance_variable_get(v).empty?
# ignore empty at_least_one_of arrays
elsif v == :@exactly_one_of && instance_variable_get(v).empty?
# ignore empty exactly_one_of arrays
elsif instance_variable_get(v) == false || instance_variable_get(v).nil?
# ignore false booleans as non-existence indicates falsey
elsif !ignored_fields.include? v
Expand Down Expand Up @@ -194,6 +206,38 @@ def conflicting
@__resource.all_user_properties.select { |p| p.conflicts.include?(@api_name) }).uniq
end

# Checks that all properties that needs at least one of their fields actually exist.
# This currently just returns if empty, because we don't want to do the check, since
# this list will have a full path for nested attributes.
def check_at_least_one_of
check :at_least_one_of, type: ::Array, default: [], item_type: ::String

return if @at_least_one_of.empty?
end

# Returns list of properties that needs at least one of their fields set.
def at_least_one_of_list
return [] unless @__resource

@at_least_one_of
end

# Checks that all properties that needs exactly one of their fields actually exist.
# This currently just returns if empty, because we don't want to do the check, since
# this list will have a full path for nested attributes.
def check_exactly_one_of
check :exactly_one_of, type: ::Array, default: [], item_type: ::String

return if @exactly_one_of.empty?
end

# Returns list of properties that needs exactly one of their fields set.
def exactly_one_of_list
return [] unless @__resource

@exactly_one_of
end

def type
self.class.name.split('::').last
end
Expand Down Expand Up @@ -289,6 +333,8 @@ class FetchedExternal < Type

def validate
@conflicts ||= []
@at_least_one_of ||= []
@exactly_one_of ||= []
end

def api_name
Expand Down
6 changes: 6 additions & 0 deletions overrides/terraform/property_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ def self.attributes
# Names of attributes that can't be set alongside this one
:conflicts_with,

# Names of attributes that at least one of must be set
:at_least_one_of,

# Names of attributes that exactly one of must be set
:exactly_one_of,

# Names of fields that should be included in the updateMask.
:update_mask_fields,

Expand Down
2 changes: 1 addition & 1 deletion overrides/terraform/resource_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def validate
@examples ||= []

check :legacy_name, type: String
check :id_format, type: String, default: '{{name}}'
check :id_format, type: String
check :examples, item_type: Provider::Terraform::Examples, type: Array, default: []
check :virtual_fields,
item_type: Provider::Terraform::VirtualFields,
Expand Down
23 changes: 18 additions & 5 deletions products/accesscontextmanager/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,15 @@ objects:
Format: "major.minor.patch" such as "10.5.301", "9.2.1".
- !ruby/object:Api::Type::Enum
name: 'osType'
required: true
description: |
The operating system type of the device.
values:
- :OS_UNSPECIFIED
- :DESKTOP_MAC
- :DESKTOP_WINDOWS
- :DESKTOP_LINUX
- :DESKTOP_CHROME_OS
- :OS_UNSPECIFIED
- :DESKTOP_MAC
- :DESKTOP_WINDOWS
- :DESKTOP_LINUX
- :DESKTOP_CHROME_OS
- !ruby/object:Api::Resource
name: 'ServicePerimeter'
# This is an unusual API, so we need to use a few fields to map the methods
Expand Down Expand Up @@ -376,6 +377,10 @@ objects:
A list of GCP resources that are inside of the service perimeter.
Currently only projects are allowed.
Format: projects/{project_number}
at_least_one_of:
- status.0.resources
- status.0.access_levels
- status.0.restricted_services
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'accessLevels'
Expand All @@ -390,6 +395,10 @@ objects:
be empty.

Format: accessPolicies/{policy_id}/accessLevels/{access_level_name}
at_least_one_of:
- status.0.resources
- status.0.access_levels
- status.0.restricted_services
item_type: Api::Type::String
- !ruby/object:Api::Type::Array
name: 'restrictedServices'
Expand All @@ -399,4 +408,8 @@ objects:
`storage.googleapis.com` is specified, access to the storage
buckets inside the perimeter must meet the perimeter's access
restrictions.
at_least_one_of:
- status.0.resources
- status.0.access_levels
- status.0.restricted_services
item_type: Api::Type::String
1 change: 1 addition & 0 deletions products/accesscontextmanager/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
update_minutes: 6
delete_minutes: 6
autogen_async: true
id_format: "{{name}}"
import_format: ["{{name}}"]
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down
13 changes: 13 additions & 0 deletions products/appengine/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ objects:
Example: 12345.
- !ruby/object:Api::Type::Enum
name: 'sslManagementType'
required: true
description: |
SSL management type for this domain. If `AUTOMATIC`, a managed certificate is automatically provisioned.
If `MANUAL`, `certificateId` must be manually specified in order to configure SSL for this domain.
Expand Down Expand Up @@ -331,16 +332,19 @@ objects:
- :REDIRECT_HTTP_RESPONSE_CODE_307
- !ruby/object:Api::Type::NestedObject
name: 'script'
# TODO (mbang): Exactly one of script, staticFiles, or apiEndpoint must be set
description: |
Executes a script to handle the requests that match this URL pattern.
Only the auto value is supported for Node.js in the App Engine standard environment, for example "script:" "auto".
properties:
- !ruby/object:Api::Type::String
name: 'scriptPath'
required: true
description: |
Path to the script from the application root directory.
- !ruby/object:Api::Type::NestedObject
name: 'staticFiles'
# TODO (mbang): Exactly one of script, staticFiles, or apiEndpoint must be set
description: |
Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.
properties:
Expand Down Expand Up @@ -403,10 +407,14 @@ objects:
name: 'zip'
description: 'Zip File'
required: false
at_least_one_of:
- deployment.0.zip
- deployment.0.files
properties:
- !ruby/object:Api::Type::String
name: 'sourceUrl'
description: 'Source URL'
required: true
- !ruby/object:Api::Type::Integer
name: 'filesCount'
description: 'files count'
Expand All @@ -417,6 +425,9 @@ objects:
Manifest of the files stored in Google Cloud Storage that are included as part of this version.
All files must be readable using the credentials supplied with this call.
required: false
at_least_one_of:
- deployment.0.zip
- deployment.0.files
key_name: 'name'
key_description: |
name of file
Expand All @@ -428,6 +439,7 @@ objects:
SHA1 checksum of the file
- !ruby/object:Api::Type::String
name: 'sourceUrl'
required: true
description: |
Source URL
- !ruby/object:Api::Type::NestedObject
Expand All @@ -438,6 +450,7 @@ objects:
properties:
- !ruby/object:Api::Type::String
name: 'shell'
required: true
description: |
The format should be a shell command that can be fed to bash -c.
- !ruby/object:Api::Type::String
Expand Down
8 changes: 3 additions & 5 deletions products/appengine/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
--- !ruby/object:Provider::Terraform::Config
overrides: !ruby/object:Overrides::ResourceOverrides
FirewallRule: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{project}}/{{priority}}"
import_format: ["{{project}}/{{priority}}"]
import_format: ["apps/{{project}}/firewall/ingressRules/{{priority}}"]
examples:
- !ruby/object:Provider::Terraform::Examples
name: "app_engine_firewall_rule_basic"
Expand All @@ -25,7 +24,6 @@ overrides: !ruby/object:Overrides::ResourceOverrides
test_env_vars:
org_id: :ORG_ID
StandardAppVersion: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "apps/{{project}}/services/{{service}}/versions/{{version_id}}"
import_format: ["apps/{{project}}/services/{{service}}/versions/{{version_id}}"]
mutex: "apps/{{project}}"
parameters:
Expand Down Expand Up @@ -73,8 +71,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
exclude: true
DomainMapping: !ruby/object:Overrides::Terraform::ResourceOverride
self_link: 'apps/{{project}}/domainMappings/{{domain_name}}'
id_format: "{{domain_name}}"
import_format: ["{{domain_name}}"]
id_format: 'apps/{{project}}/domainMappings/{{domain_name}}'
import_format: ['apps/{{project}}/domainMappings/{{domain_name}}']
examples:
- !ruby/object:Provider::Terraform::Examples
name: "app_engine_domain_mapping_basic"
Expand Down
1 change: 1 addition & 0 deletions products/bigquery/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ objects:
description: An email address of a Google Group to grant access to.
- !ruby/object:Api::Type::String
name: 'role'
required: true
description: |
Describes the rights granted to the user specified by the other
member of the access object. Primitive, Predefined and custom
Expand Down
3 changes: 1 addition & 2 deletions products/bigquery/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
legacy_name: 'bigquery'
overrides: !ruby/object:Overrides::ResourceOverrides
Dataset: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{project}}:{{dataset_id}}"
import_format: ["{{project}}:{{dataset_id}}", "{{project}}/{{dataset_id}}", "{{dataset_id}}"]
import_format: ["projects/{{project}}/datasets/{{dataset_id}}"]
delete_url: projects/{{project}}/datasets/{{dataset_id}}?deleteContents={{delete_contents_on_destroy}}
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down
11 changes: 7 additions & 4 deletions products/bigtable/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,26 @@ objects:
Long form description of the use case for this app profile.
- !ruby/object:Api::Type::Boolean
name: 'multiClusterRoutingUseAny'
conflicts:
- singleClusterRouting
exactly_one_of:
- single_cluster_routing
- multi_cluster_routing_use_any
description: |
If true, read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available
in the event of transient errors or delays. Clusters in a region are considered equidistant. Choosing this option sacrifices read-your-writes
consistency to improve availability.
input: true
- !ruby/object:Api::Type::NestedObject
name: 'singleClusterRouting'
conflicts:
- multiClusterRoutingUseAny
exactly_one_of:
- single_cluster_routing
- multi_cluster_routing_use_any
description: |
Use a single-cluster routing policy.
input: true
properties:
- !ruby/object:Api::Type::String
name: 'clusterId'
required: true
description: |
The cluster to which read/write requests should be routed.
- !ruby/object:Api::Type::Boolean
Expand Down
2 changes: 1 addition & 1 deletion products/bigtable/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
--- !ruby/object:Provider::Terraform::Config
overrides: !ruby/object:Overrides::ResourceOverrides
AppProfile: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{project}}/{{instance}}/{{app_profile_id}}"
id_format: "projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}}"
import_format: ["projects/{{project}}/instances/{{instance}}/appProfiles/{{app_profile_id}}"]
examples:
- !ruby/object:Provider::Terraform::Examples
Expand Down
5 changes: 5 additions & 0 deletions products/binaryauthorization/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ objects:
See the documentation on publicKey cases below for details.
- !ruby/object:Api::Type::String
name: asciiArmoredPgpPublicKey
# TODO (mbang): Exactly one of asciiArmoredPgpPublicKey or pkixPublicKey must be set
description: |
ASCII-armored representation of a PGP public key, as the
entire output by the command
Expand All @@ -108,6 +109,7 @@ objects:
be overwritten by the API-calculated ID.
- !ruby/object:Api::Type::NestedObject
name: pkixPublicKey
# TODO (mbang): Exactly one of asciiArmoredPgpPublicKey or pkixPublicKey must be set
description: |
A raw PKIX SubjectPublicKeyInfo format public key.

Expand Down Expand Up @@ -178,6 +180,7 @@ objects:
properties:
- !ruby/object:Api::Type::String
name: namePattern
required: true
description: |
An image name pattern to whitelist, in the form
`registry/path/to/image`. This supports a trailing * as a
Expand All @@ -202,6 +205,7 @@ objects:
properties:
- !ruby/object:Api::Type::Enum
name: evaluationMode
required: true
description: How this admission rule will be evaluated.
values:
- :ALWAYS_ALLOW
Expand All @@ -221,6 +225,7 @@ objects:
item_type: Api::Type::String
- !ruby/object:Api::Type::Enum
name: enforcementMode
required: true
description: |
The action when a pod creation is denied by the admission rule.
values:
Expand Down
5 changes: 2 additions & 3 deletions products/binaryauthorization/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
overrides: !ruby/object:Overrides::ResourceOverrides
Attestor: !ruby/object:Overrides::Terraform::ResourceOverride
import_format: ["projects/{{project}}/attestors/{{name}}"]
id_format: "{{project}}/{{name}}"
examples:
- !ruby/object:Provider::Terraform::Examples
name: "binary_authorization_attestor_basic"
Expand All @@ -39,7 +38,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
properties:
name: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.erb'
custom_expand: 'templates/terraform/custom_expand/binaryauthorization_attestor_name.erb'
custom_expand: 'templates/terraform/custom_expand/shortname_to_url.go.erb'
attestationAuthorityNote.noteReference: !ruby/object:Overrides::Terraform::PropertyOverride
custom_expand: 'templates/terraform/custom_expand/container_analysis_note.erb'
diff_suppress_func: 'compareSelfLinkOrResourceName'
Expand All @@ -54,7 +53,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
attestationAuthorityNote.publicKeys.id: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
Policy: !ruby/object:Overrides::Terraform::ResourceOverride
id_format: "{{project}}"
id_format: "projects/{{project}}"
import_format: ["projects/{{project}}"]
custom_code: !ruby/object:Provider::Terraform::CustomCode
constants: 'templates/terraform/constants/binaryauthorization_policy.erb'
Expand Down
Loading