* add import helpers for generated code
* Updates to backend bucket and transport.go from MM
* add generated http(s)_health_check resources
* name is required; transport import style
* update docs with new fields/timeouts
* fixes
* Support `distributionPolicy` when creating regional instance group managers.
* Better match the API structure of distributionPolicy.
* Switch to "distribution_policy_zones".
This approach lets us more simply allow a list of zones to use, while
providing a deprecation path for implementing the distribution policy
field more holistically, avoiding backwards-incompatible changes.
* fix typo
* use slice instead of Set for flattenDP
* Storage Default Object ACL resource
* Fixed the doc
* Renamed the resource id. Log change
* Complying with go vet
* Changes for review
* link to default object acl docs in sidebar
* Support for GCS notifications
* docs for storage notification
* docs for storage notification
* Clarified the doc
* Doc modifications
* Addressing requested changes from review
* Addressing requested changes from review
* Using ImportStatePassthrough
* Storage Default Object ACL resource
* Fixed the doc
* Renamed the resource id. Log change
* Complying with go vet
* Changes for review
* link to default object acl docs in sidebar
* Import google_compute_shared_vpc_host_project/google_compute_shared_vpc_service_project resources.
* Incorporate testing of resource import into main acceptance tests.
* Add update support for compute instance fields that require the machine to be stopped
* add warnings in docs about stopping the instance before updating
* add allow_stopping_for_update field
* Update sqladmin api
Pull in updates to the generated sqladmin api and update callers for
the change in the StorageAutoResize setting
* Add support for availability_type setting
Allow specifying ZONAL or REGIONAL to allow for PostgreSQL HA
setup.
* vendor: update sqladmin/v1beta4
* Test setting AvailabilityType for PostgreSQL
Add tests that cover the creation of a Postgres database with
AvailabilityType set to REGIONAL, and correct some small issues that
were preventing compilation.
* Fix breaking change w/ disk_autoresize in cloudsql
95e5582766
The cloudsql admin client changed the way it handles StorageAutoResize
as a parameter, in order to be more explicit about when the server has
ommitted the field. This changed the type from being bool to *bool, and
we need to modify provider code so that we supply the right value to the
api client.
* read boot disk initialization param from API
* make fmt
* Mark the initialize_params list as computed to support boot source
* Ensure private family test follow naming pattern
* Improve docs
* Add import support to google_dns_record_set
* Add import test to NS record
* Minimize diff change
* Improve docs
* Make error message more helpful
* Add note about trailing dot at the end of the record name
Add support for Google Dataflow jobs
Note: A dataflow job exists when it is in a nonterminal state, and does not exist if it
is in a terminal state (or a non-running state which can only transition into terminal
states). See doc for more detail.
* Add internalIpOnly support for Dataproc clusters
* Add internal_ip_only to dataproc cluster docs
* Add default/basic dataproc internal ip test case
* Add test for dataproc internal_ip_only=true
* fixup cluster_config.gce_cluster_config to include .0.
* Remove redundant depends_on
* Add %s rnd to network and subnetwork
* Use variable for subnet CIDR and reference via source_ranges
* Add depends_on back to dataproc cluster test
* Fix cluster attribute refs (.0. again)
* Add 'google_organization' data source.
* Use 'GetResourceNameFromSelfLink'.
* Remove 'resourcemanager_helpers'.
* Use 'ConflictsWith' in schema.
* Add 'organization' argument and make 'name' an output-only attribute.
* Add 'google_billing_account' data source.
* Use 'GetResourceNameFromSelfLink'.
* Use 'ConflictsWith' in schema.
* Use pagination for List() API call.
* Add ability to filter by 'open' attribute.
* Don't use 'ForceNew' for data sources.
* Add 'billing_account' argument and make 'name' an output-only attribute.
* Correct error message.
* Add google_kubernetes_cluster datasource
Add documentation for google_kubernetes_cluster datasource
Rename datasource to google_container_cluster
To be consistent with the equivalent resource.
Rename datasource in docs.
google_kubernetes_cluster -> google_container_cluster.
Also add reference in google.erb file.
WIP
Datasource read needs to set an ID, then call resource read func
Add additional cluster attributes to datasource schema
* Generate datasource schema from resource
Datasource documentation also updated.
* add test for datasourceSchemaFromResourceSchema
* Code review changes
* Add IAM support for pubsub topic
* Fix resource name
* Add update test for iam_policy resource
* Standardize policy conversion function
* Standardize policy conversion function all resources
* Create google_kms_secret datasource
* Create google_kms_secret datasource documentation
* Remove duplicated code
* Create acceptance test
* Fix indentation
* Add documentation to sidebar
* Update Cloud SDK link in docs
* Oxford comma
* Rename variable to make it clear which resource is under test
* Update test to use utils from provider_test
* Add new data source: compute region instance group manager's groups.
* Add documentation for wait_for_instances and for the timeout mechanism in resourceComputeRegionInstanceGroupManagerCreate.
Add consistency for for IAM imports.
- Adds imports for projects, folders, crypto keys, organizations, and key rings.
- Anything else with IAM can implement a simple method and begin working immediately.
- Add tests for all the IAM imports.
- Import documentation for IAM resources.
We removed ipv4_range, but the API still exists, it's just deprecated.
This breaks configs for users that haven't migrated off yet. I added it
back, added some tests to use it, included it in the docs, and basically
tried to put things back the way they were. The main difference now is
that the auto_create_subnetworks field defaults to true, and we want to
keep that behaviour to avoid a breaking change. So now if users want to
use the lagacy API, they need to set auto_create_subnetworks to false
explicitly.
* Move AliasIpRange helpers into utils
To reflect the fact they'll be used by multiple resources.
* Pass Config to build helpers, not meta
It's the only thing meta is used for.
* Refactor getNetwork util methods to return early for the happy path.
* Update compute APIs
compute.Instance.MinCpuPlatform is now GA.
* Fix panic in TestComputeInstanceMigrateState
This seemed to be a pre-existing issue, i.e. I could repro it in master.
--- FAIL: TestComputeInstanceMigrateState (0.00s)
panic: interface conversion: interface {} is nil, not *google.Config [recovered]
panic: interface conversion: interface {} is nil, not *google.Config
goroutine 85 [running]:
testing.tRunner.func1(0xc4205d60f0)
/usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:711 +0x2d2
panic(0x203acc0, 0xc4205d2080)
/usr/local/Cellar/go/1.9.1/libexec/src/runtime/panic.go:491 +0x283
github.com/terraform-providers/terraform-provider-google/google.migrateStateV3toV4(0xc4205f2000, 0x0, 0x0, 0x0, 0x48, 0xc4205f2000)
/Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate.go:182 +0x2405
github.com/terraform-providers/terraform-provider-google/google.resourceComputeInstanceMigrateState(0x2, 0xc4205f2000, 0x0, 0x0, 0x0, 0x0, 0xe0000000000)
/Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate.go:48 +0x21a
github.com/terraform-providers/terraform-provider-google/google.runInstanceMigrateTest(0xc4205d60f0, 0x2260816, 0x8, 0x227d23a, 0x20, 0x2, 0xc4205ec0f0, 0xc4205ec120, 0x0,
0x0)
/Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate_test.go:803 +0xc1
github.com/terraform-providers/terraform-provider-google/google.TestComputeInstanceMigrateState(0xc4205d60f0)
/Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate_test.go:71 +0xc84
testing.tRunner(0xc4205d60f0, 0x22d81c0)
/usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:746 +0xd0
created by testing.(*T).Run
/usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:789 +0x2de
FAIL github.com/terraform-providers/terraform-provider-google/google 0.035s
* Use only the v1 API for resource_compute_instance
Alias IP ranges, Accelerators, and min CPU platform are now GA.
* Move common instance code into utils.go
Methods used by both resource_compute_instance and
resource_compute_instance_template are currently spread between their respective
files, and utils.go.
This commit moves them all into utils.go for the sake of consistency. It may be
worth considering an instance_common.go file or similar.
* Unify compute_instance and compute_instance_template network_interface and service_account code
This has the side effect of enabling Alias IP range support for
compute_instance_templates.
* Add tests for compute instance template Alias IP ranges
* Mark instance template region as computed
We compute it from the subnet its network interfaces are in. Note this
is not new behaviour - I believe it was erroneously missing the computed
flag.
* Support guest accelerators for instance templates
Since most of the code is already there.
* Add a test for using 'address' rather than 'network_ip' for instance templates
* Don't mark assigned_nat_ip as deprecated
* Remove network_interface schema fields that don't make sense for a compute instance template
* Add newline after count in instance template docs
* Don't try to dedupe guest accelerator expansion code
The API calls to Google to create guest accelerators take different values
for instances and instance templates. Instance templates don't have a zone
and can thus *only* be passed a guest accelerator name.
* Use ParseNetworkFieldValue instead of getNetworkLink
* Add support for parsing regional fields, and subnetworks specifically
Currently unused because subnetworks may have a separate project from that
of the instance using them, which complicates looking up the project field.
* Fall back to provider region when parsing regional field values
Also slightly refactors getXFromSchema field helper functions for readability.
* Revert to assigned_nat_ip in compute instance docs
* Add beta scaffolding to compute instance and compute instance template
Note these resources don't currently use beta features - this is futureproofing.
* Fix indentation in comment about instance template alias IP ranges
* Consolidate metadata helper functions in metadata.go
* Move compute instance (and template) related helpers into their own file
* add support for ip aliasing in `google_container_cluster`
* [review] cleanup galore, infer feature enablement from `ip_allocation_policy`
* [review] cleanup, round 2
* add nil check back (when reading ip allocation policy from API)
* Add IAM bindings and member resources for KMS KeyRings
* Add IAM bindings and member resources for KMS CryptoKeys
* Docs for key ring and crypto key IAM resources
* Exctract KMS policy conversions to helper functions
* Split iam_binding and iam_member tests for KMS
* Docs for kms IAM member resources
* Run KMS IAM tests in own project
* add support for `google_container_node_pool` management (sans-tests)
* [review] add tests, docs, general cleanup
* add docs
* [review] amend test to check updates and terraform fmt
* test updates, make nested management fields non-computed
* Add the "compute_global_address" datasource
* Add a basic test for the "compute_global_address" datasource
* Include the "compute_global_address" in the provider
* Add docs for the "compute_global_address" datasource
* Remove import support for org policy
* Add ForceNew to org_id field
* Revert "Remove import support for org policy"
This reverts commit f65d9fb347d6b0998be55ef823c5726e876c53ae.
* Add import documentation for google_organization_policy
* Add the "compute_address" datasource
* Add a basic test for the "compute_address" datasource
* Include the "compute_address" datasource in the provider
* Add the documentation for the "compute_address" datasource
* Adds support for creating KMS CryptoKeys resources
* Destroy extant CryptoKeyVersions on CryptoKey destroy
* Inherit project, location etc from KeyRing in CryptoKey
* Add function to calculate next rotation
* Implement RotationPeriod parameter on CryptoKey
* Import CryptoKey state
* Uncommit my local acceptance test hacks
* Docs for google_kms_crypto_key
* Clear id at the end of CryptoKey deletion
Also add more detail to warning message.
* Fix parseCryptoKeyId error messages
* Use correct naming in CryptoKeyIdParsing test
* Check RotationPeriod is present in acceptance test
* Rename variable in test function for consistency
* Fix wrong resource name in cryptokey docs
* Add KeyRing to CryptoKey doc example
* Run test CryptoKey configs through terraform fmt
* Don't set CryptoKey purpose in terraform state on import
* Fix indentation in CryptoKey test
* Parallelise CryptoKey tests
* Set rotation_key on CryptoKey read
* Move RotationPeriod validation to planning phase
* Use import state passthrough for CryptoKey
* Correct casing issues in test case names
* Remove redundant CheckDestroy calls in CryptoKey tests
* Add explanatory comment about extra test steps
* More explicit error handling in CryptoKey tests
* Explicit dependency on project services in test keyring configs
* Clean up comments in cryptokey resource
* Do not repeat in cryptokey id regexes
The documentation pages for these two resources were previously a little
muddled, with the argument references swapped and a non-working example
for the host project.
- Accepts self_link in addition of health check name
- Removes the need for an API call to generate the self link
- Improves the documentation to mention that only the legacy google_compute_http_health_check is supported. This will prevent our user from being stuck like mentioned here: #300.
- Adds a MaxItems:1 in the schema. You can't have more than one. The API will fail. The official docs also says so.
- Adds a check to the acceptance test to ensure the health checks are properly setup.
* Add support for maintenance window on google_container_cluster (#526)
* Address review comments
- Set ForceNew: true on the schema element daily_maintenance_window
- Correct resource name in acceptance test
- Correct documentation of resource attribute maintenance_policy.0.daily_maintenance_window.0.duration
* fixing example of google_storage_object_acl
some of the resource names seem to be incorrect. fixing to reflect
the actual resource names in the example.
* fixup
forgot to add `.name` here.
* Add support for Kubernetes alpha features
* Add tests for support of Kubernetes alpha features
* Fix dodgy copy and paste operations
* Add documentation
Rename all ID fields to {resource_noun}_id instead of removing them
outright. This means people can still get at the info.
Leave project's id deleted. It has been marked as Removed for months.
I'm fine with cleaning it up before 1.0.0.
Also, update website docs.
* Instantiate the cloudkms client
* Implement Create and Read for the kms key ring resource
* Expose the kms key ring resource
* Create acceptance test for creating a KeyRing, fix read to use KeyRing ID
* Add cloudkms library to vendor
* Address style comments
* Use fully-qualified keyring name in read operation
* Remove call to SetId during read operation
* Set ID as entire resource string
* Spin up a new project for acceptance test
* Use Getenv for billing and org environment variables
* And test and logs around removal from state
* Add comments
* Fixes formatting
* Log warning instead of info
* Use a single line for cloudkms client actions
* Add resource import test
* Add ability to import resource, update helper functions to use keyRingId struct
* Use shorter terraform ID for easier import
* Update import test to use the same config as the basic test
* Update KeyRing name regex to be consistent with API docs
* Add documentation page for resource
* Add KeyRing documentation to sidebar
* Adds unit tests around parsing the KeyRing import id
* Allow for project in id to be autopopulated from config
* Throw error in import if project provider is not provided for location/name format
* Consistent variable names
* Use tabs in resource config instead of spaces
* Remove "-x" suffix for docs
* Set project attribute on import if different from the project config
* Initial support for google service account keys
* Add vendor for vault and encryption
* Add change for PR comment
* Add doc and improvement fo public key management
* adding waiter for compatibility with issue google/google-api-go-client#234
* improvement
* Add test with pgp_key
* Perform doc anf format
* remove test if public_key exists
* Add link on doc
* correct pr
* Make google_service_account resource importable
* Add google_service_account testcase with default project
* Mark google_service_account.project as computed to ensure the project id is always stored in the state, defined in configuration or not. Add corresponding test cases
* Inline variables with single usage
* Replace tabs with spaces in configuration strings
* Ensure service account is not recreated when the default project is explicitely added to the configuration
* camelcase
* disk cleanup
* fix attached disk test
* allow disk sources from name or url
* parse disk source better on read
* update docs
* fix boot disk source url
* Reorder fields in schema for style consistency
* Add reusable ZonalFieldValue
* Fix import and read state from API for compute route
* Generate network link without calling the API
+ Make the org_id optional when creating a project. Closes#131
+ Mark org_id as computed to allow for GCP automatically assigning the org.
+ Add an acceptance test for project creation without an organization.
+ Skip TestAccGoogleProject_createWithoutOrg if GOOGLE_ORG is set.
+ Add a folder_id to the google_project resource, optionally
specifying the ID of the GCP folder in which the GCP project should
live.
+ Document how one can provision a project into a folder, and added a
sample configuration to create a project into an existing folder.
* Skip test without org if service account is used
* Support folders/* or id only for the folder id field
* Vendor cloud logging api
* Add logging sink support
* Remove typo
* Set Filter simpler
* Rename typ, typName to resourceType, resourceId
* Handle notFoundError
* Use # instead of // for hcl comments
* Cleanup test code
* Change testAccCheckLoggingProjectSink to take a provided api object
* Fix whitespace change after merge conflict
* Add preemptible as an option to node config
* Check for preemptible in test matching functions
* Move flattenClusterNodeConfig to node_config
* Handle bools properly when comparing in cluster and node pool tests
* Use a supported image_type in cluster tests
* Vendor runtimeconfig
* Add support for RuntimeConfig config and variable resources
This allows users to create/manage Google RuntimeConfig resources and
variables. More information here:
https://cloud.google.com/deployment-manager/runtime-configurator/Closes#236
* Remove typo
* Use top-level declaration rather than init()
* Cleanup testing-related code by using ConflictsWith
Also adds better comments around how update works
* govendor fetch cloud.google.com/go/bigtable
* Vendor the rest of the stuff.
* Add support for instance_type to google_bigtable_instance.
* Revendored some packages.
* Removed bad packages from vendor.json
* Mark google_sql_database.{charset,collation} as computed instead of having defaults.
This change is required to avoid the following scenario:
When upgrading from a previous version of the Google provider, TF will change
the charset/collation of existing (TF-managed) databases to utf8/utf8_general_ci
(if the user hasn't added different config values before running TF apply),
potentially overriding any non-default settings that the user my have applied
through the Cloud SQL admin API. This violates POLA.
* Remove charset/collation defaults from the documentation, too.
* Add links to MySQL's and PostgreSQL's documentation about supported charset and collation values.
* Use version 5.7's docs instead of 5.6, since that's the most up to date version of MySQL that we support.
* Add a note that only UTF8 / en_US.UTF8 are currently supported for Cloud SQL PostgreSQL databases.
* Add versioned Beta support to google_compute_firewall.
* Add Beta support for deny to google_compute_firewall.
* remove extra line:
* make fmt
* Add missing ForceNew fields.
* Respond to review comments testing functionality + reducing network GET to v1
* Make google_compute_global_address a versioned resource with Beta support.
* Added Beta support for ip_version in google_compute_global_address.
* Move checks to TestCheckFuncs, add a regression test for IPV4 on v1 resources.
* Consolidated TestCheckFuncs to a single function.
* Add missing return statement.
* Fix IPV4 test
* Clarified comment.
* Add versioned Beta support to google_compute_global_forwarding_rule.
* Add Beta support for ip_version in google_compute_global_forwarding_rule.
* Temporary commit with compute_shared_operation.go changes.
* Added a test to see if v1 GFR is still IPV4, moved to a TestCheckFunc
* This API returns the original self links, but let's make sure we don't diff.
* Add support for auto_healing_policies to google_compute_instance_group_manager.
* Add a test for self link stability when a v1 resource uses a versioned resource.
* Add a comment about what the stable self link test does.
* make fmt
* Fixed formatting on new tests.
* Address review comments.
* Fix make vet
* Add support node config for GKE node pool
* Review fixes:
- Set max items in node config schema
- Fill missing node config fields
- Put test helpers above than test vars
* Update checks in node pool tests
* Fix node pool check match
* Revert "Add additional fingerprint error to check for when updating metadata (#221)"
This reverts commit 4c8f62edf6.
* Revert "Fix bug where range variable is improperly dereferenced (#217)"
This reverts commit 8f75c1c9a5.
* Revert "Add support for google_compute_project_metadata_item (#176)"
This reverts commit 236c0f5d24.
* Add support for google_compute_project_metadata_item
This allows terraform users to manage single key/value items within the
project metadata map, rather than the entire map itself.
* Update CHANGELOG.md
* Add details about import
* Add charset and collation to google_sql_database.
* Add documentation for charset, collation attributes.
* Extend the existing acceptance test to also cover charset and collation.
* Charset and collation always have a value present. Also inline.
* Move charset and collation to optional arguments.
* Add charset and collection to the example.
* Document charset and collation defaults.
* Keep TestAccGoogleSqlDatabase_basic as is, add TestAccGoogleSqlDatabase_update.
* Add import support for google_compute_image.
* Added comment explaning why we set the create_timeout in the import state method
* Don't ForceNew for create_timeout field
* Update image name in import documentation
* update compute instance docs to use new boot and scratch disk attributes, document attached_disk
* Update compute instance tests to mostly use new boot and scratch disk attributes
* Fix encryption test by setting values in state from what was there before
* Add scratch_disk property to google_compute_instance
* docs for scratch_disk
* limit scope of scratchDisks array by using bool, test formatting
* add slash back to disk check
* Add boot_disk property to google_compute_instance
* docs for boot_disk
* limit scope of bootDisk, use bool instead
* test formatting
* make device_name forcenew, add sha256 encryption key
* compute_disk: update image in test
* disk_image: add default type, make size computed
* compute_dis: wait on disk size operations to complete before moving on
* update docks on the image
* Add compute_backend_service import support
* Fixed the nit
* Made example names a bit more intuitive
* Use underscores wherever possible instead of dashes
* Mention PostgreSQL in sql_database_instance docs
As mentioned in hashicorp/terraform#12617 the
google_sql_database_instance resource already supports `POSTGRES_9_6` as
`database_version`, it is just undocumented so far.
* Make naming of google_sql_database consistent
Looks like this is a relict from some copy & paste from
`google_storage_*` while writing the docs for `google_sql_database`.
* Note that Postgres support is still BETA