mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 07:42:40 +00:00
[Terraform]: Apply gofmt -s to all files managed by MM (#2676)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
This commit is contained in:
parent
593156e918
commit
c605b0bc4b
|
@ -12,7 +12,7 @@ func TestAccDataSourceComputeLbIpRanges_basic(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeLbIpRangesConfig,
|
Config: testAccComputeLbIpRangesConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
resource.TestMatchResourceAttr("data.google_compute_lb_ip_ranges.some",
|
resource.TestMatchResourceAttr("data.google_compute_lb_ip_ranges.some",
|
||||||
|
|
|
@ -7,22 +7,22 @@ func dataSourceDnsManagedZone() *schema.Resource {
|
||||||
Read: dataSourceDnsManagedZoneRead,
|
Read: dataSourceDnsManagedZoneRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"dns_name": &schema.Schema{
|
"dns_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"name_servers": &schema.Schema{
|
"name_servers": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Elem: &schema.Schema{
|
Elem: &schema.Schema{
|
||||||
|
@ -32,7 +32,7 @@ func dataSourceDnsManagedZone() *schema.Resource {
|
||||||
|
|
||||||
// Google Cloud DNS ManagedZone resources do not have a SelfLink attribute.
|
// Google Cloud DNS ManagedZone resources do not have a SelfLink attribute.
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,7 @@ func TestAccDataSourceDnsManagedZone_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckDnsManagedZoneDestroy,
|
CheckDestroy: testAccCheckDnsManagedZoneDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceDnsManagedZone_basic(),
|
Config: testAccDataSourceDnsManagedZone_basic(),
|
||||||
Check: testAccDataSourceDnsManagedZoneCheck("data.google_dns_managed_zone.qa", "google_dns_managed_zone.foo"),
|
Check: testAccDataSourceDnsManagedZoneCheck("data.google_dns_managed_zone.qa", "google_dns_managed_zone.foo"),
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,15 +13,15 @@ func dataSourceGoogleActiveFolder() *schema.Resource {
|
||||||
Read: dataSourceGoogleActiveFolderRead,
|
Read: dataSourceGoogleActiveFolderRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"parent": &schema.Schema{
|
"parent": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"display_name": &schema.Schema{
|
"display_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,7 @@ func TestAccDataSourceGoogleActiveFolder_default(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleActiveFolderConfig(parent, displayName),
|
Config: testAccDataSourceGoogleActiveFolderConfig(parent, displayName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleActiveFolderCheck("data.google_active_folder.my_folder", "google_folder.foobar"),
|
testAccDataSourceGoogleActiveFolderCheck("data.google_active_folder.my_folder", "google_folder.foobar"),
|
||||||
|
@ -39,7 +39,7 @@ func TestAccDataSourceGoogleActiveFolder_space(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleActiveFolderConfig(parent, displayName),
|
Config: testAccDataSourceGoogleActiveFolderConfig(parent, displayName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleActiveFolderCheck("data.google_active_folder.my_folder", "google_folder.foobar"),
|
testAccDataSourceGoogleActiveFolderCheck("data.google_active_folder.my_folder", "google_folder.foobar"),
|
||||||
|
|
|
@ -19,33 +19,33 @@ func dataSourceGoogleComputeAddress() *schema.Resource {
|
||||||
Read: dataSourceGoogleComputeAddressRead,
|
Read: dataSourceGoogleComputeAddressRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"address": &schema.Schema{
|
"address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"status": &schema.Schema{
|
"status": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
|
|
@ -81,7 +81,7 @@ func TestAccDataSourceComputeAddress(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckDataSourceComputeAddressDestroy(rsFullName),
|
CheckDestroy: testAccCheckDataSourceComputeAddressDestroy(rsFullName),
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceComputeAddressConfig(rsName, dsName),
|
Config: testAccDataSourceComputeAddressConfig(rsName, dsName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceComputeAddressCheck(dsFullName, rsFullName),
|
testAccDataSourceComputeAddressCheck(dsFullName, rsFullName),
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestAccDataSourceComputeBackendService_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceComputeBackendService_basic(serviceName, checkName),
|
Config: testAccDataSourceComputeBackendService_basic(serviceName, checkName),
|
||||||
Check: testAccDataSourceComputeBackendServiceCheck("data.google_compute_backend_service.baz", "google_compute_backend_service.foobar"),
|
Check: testAccDataSourceComputeBackendServiceCheck("data.google_compute_backend_service.baz", "google_compute_backend_service.foobar"),
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,75 +11,75 @@ func dataSourceGoogleComputeForwardingRule() *schema.Resource {
|
||||||
Read: dataSourceGoogleComputeForwardingRuleRead,
|
Read: dataSourceGoogleComputeForwardingRuleRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"target": &schema.Schema{
|
"target": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"backend_service": &schema.Schema{
|
"backend_service": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_address": &schema.Schema{
|
"ip_address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_protocol": &schema.Schema{
|
"ip_protocol": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"load_balancing_scheme": &schema.Schema{
|
"load_balancing_scheme": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network": &schema.Schema{
|
"network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"port_range": &schema.Schema{
|
"port_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ports": &schema.Schema{
|
"ports": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"subnetwork": &schema.Schema{
|
"subnetwork": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,7 @@ func TestAccDataSourceGoogleForwardingRule(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleForwardingRuleConfig(poolName, ruleName),
|
Config: testAccDataSourceGoogleForwardingRuleConfig(poolName, ruleName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleForwardingRuleCheck("data.google_compute_forwarding_rule.my_forwarding_rule", "google_compute_forwarding_rule.foobar-fr"),
|
testAccDataSourceGoogleForwardingRuleCheck("data.google_compute_forwarding_rule.my_forwarding_rule", "google_compute_forwarding_rule.foobar-fr"),
|
||||||
|
|
|
@ -12,27 +12,27 @@ func dataSourceGoogleComputeGlobalAddress() *schema.Resource {
|
||||||
Read: dataSourceGoogleComputeGlobalAddressRead,
|
Read: dataSourceGoogleComputeGlobalAddressRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"address": &schema.Schema{
|
"address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"status": &schema.Schema{
|
"status": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
|
|
@ -21,7 +21,7 @@ func TestAccDataSourceComputeGlobalAddress(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeGlobalAddressDestroy,
|
CheckDestroy: testAccCheckComputeGlobalAddressDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceComputeGlobalAddressConfig(rsName, dsName),
|
Config: testAccDataSourceComputeGlobalAddressConfig(rsName, dsName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceComputeGlobalAddressCheck(dsFullName, rsFullName),
|
testAccDataSourceComputeGlobalAddressCheck(dsFullName, rsFullName),
|
||||||
|
|
|
@ -19,7 +19,7 @@ func TestAccDataSourceComputeInstance_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceComputeInstanceConfig(instanceName),
|
Config: testAccDataSourceComputeInstanceConfig(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceComputeInstanceCheck("data.google_compute_instance.bar", "google_compute_instance.foo"),
|
testAccDataSourceComputeInstanceCheck("data.google_compute_instance.bar", "google_compute_instance.foo"),
|
||||||
|
|
|
@ -11,27 +11,27 @@ func dataSourceGoogleComputeNetwork() *schema.Resource {
|
||||||
Read: dataSourceGoogleComputeNetworkRead,
|
Read: dataSourceGoogleComputeNetworkRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"gateway_ipv4": &schema.Schema{
|
"gateway_ipv4": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,7 @@ func TestAccDataSourceGoogleNetwork(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleNetworkConfig(networkName),
|
Config: testAccDataSourceGoogleNetworkConfig(networkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleNetworkCheck("data.google_compute_network.my_network", "google_compute_network.foobar"),
|
testAccDataSourceGoogleNetworkCheck("data.google_compute_network.my_network", "google_compute_network.foobar"),
|
||||||
|
|
|
@ -15,7 +15,7 @@ func dataSourceGoogleComputeRegions() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
Read: dataSourceGoogleComputeRegionsRead,
|
Read: dataSourceGoogleComputeRegionsRead,
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -16,7 +16,7 @@ func TestAccDataSourceGoogleSslPolicy(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleSslPolicy(),
|
Config: testAccDataSourceGoogleSslPolicy(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleSslPolicyCheck("data.google_compute_ssl_policy.ssl_policy", "google_compute_ssl_policy.foobar"),
|
testAccDataSourceGoogleSslPolicyCheck("data.google_compute_ssl_policy.ssl_policy", "google_compute_ssl_policy.foobar"),
|
||||||
|
|
|
@ -13,58 +13,58 @@ func dataSourceGoogleComputeSubnetwork() *schema.Resource {
|
||||||
Read: dataSourceGoogleComputeSubnetworkRead,
|
Read: dataSourceGoogleComputeSubnetworkRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"ip_cidr_range": &schema.Schema{
|
"ip_cidr_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"private_ip_google_access": &schema.Schema{
|
"private_ip_google_access": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"secondary_ip_range": &schema.Schema{
|
"secondary_ip_range": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"range_name": &schema.Schema{
|
"range_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"ip_cidr_range": &schema.Schema{
|
"ip_cidr_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"network": &schema.Schema{
|
"network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"gateway_address": &schema.Schema{
|
"gateway_address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
|
|
@ -16,7 +16,7 @@ func TestAccDataSourceGoogleSubnetwork(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleSubnetwork(),
|
Config: testAccDataSourceGoogleSubnetwork(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleSubnetworkCheck("data.google_compute_subnetwork.my_subnetwork", "google_compute_subnetwork.foobar"),
|
testAccDataSourceGoogleSubnetworkCheck("data.google_compute_subnetwork.my_subnetwork", "google_compute_subnetwork.foobar"),
|
||||||
|
|
|
@ -12,34 +12,34 @@ func dataSourceGoogleComputeVpnGateway() *schema.Resource {
|
||||||
Read: dataSourceGoogleComputeVpnGatewayRead,
|
Read: dataSourceGoogleComputeVpnGatewayRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network": &schema.Schema{
|
"network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,7 @@ func TestAccDataSourceGoogleVpnGateway(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccDataSourceGoogleVpnGatewayConfig(vpnGatewayName),
|
Config: testAccDataSourceGoogleVpnGatewayConfig(vpnGatewayName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccDataSourceGoogleVpnGatewayCheck("data.google_compute_vpn_gateway.my_vpn_gateway", "google_compute_vpn_gateway.foobar"),
|
testAccDataSourceGoogleVpnGatewayCheck("data.google_compute_vpn_gateway.my_vpn_gateway", "google_compute_vpn_gateway.foobar"),
|
||||||
|
|
|
@ -19,7 +19,7 @@ func dataSourceGoogleComputeZones() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -10,7 +10,7 @@ func dataSourceGoogleIamRole() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
Read: dataSourceGoogleIamRoleRead,
|
Read: dataSourceGoogleIamRoleRead,
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,15 +14,15 @@ func dataSourceGoogleKmsSecret() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
Read: dataSourceGoogleKmsSecretRead,
|
Read: dataSourceGoogleKmsSecretRead,
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"crypto_key": &schema.Schema{
|
"crypto_key": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"ciphertext": &schema.Schema{
|
"ciphertext": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"plaintext": &schema.Schema{
|
"plaintext": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
|
|
|
@ -29,7 +29,7 @@ func TestAccKmsSecret_basic(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleKmsCryptoKey_basic(projectId, projectOrg, projectBillingAccount, keyRingName, cryptoKeyName),
|
Config: testGoogleKmsCryptoKey_basic(projectId, projectOrg, projectBillingAccount, keyRingName, cryptoKeyName),
|
||||||
Check: func(s *terraform.State) error {
|
Check: func(s *terraform.State) error {
|
||||||
ciphertext, cryptoKeyId, err := testAccEncryptSecretDataWithCryptoKey(s, "google_kms_crypto_key.crypto_key", plaintext)
|
ciphertext, cryptoKeyId, err := testAccEncryptSecretDataWithCryptoKey(s, "google_kms_crypto_key.crypto_key", plaintext)
|
||||||
|
@ -43,7 +43,7 @@ func TestAccKmsSecret_basic(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleKmsSecret_datasource(cryptoKeyId.terraformId(), ciphertext),
|
Config: testGoogleKmsSecret_datasource(cryptoKeyId.terraformId(), ciphertext),
|
||||||
Check: resource.TestCheckResourceAttr("data.google_kms_secret.acceptance", "plaintext", plaintext),
|
Check: resource.TestCheckResourceAttr("data.google_kms_secret.acceptance", "plaintext", plaintext),
|
||||||
},
|
},
|
||||||
|
|
|
@ -93,7 +93,7 @@ func getCidrBlocks() (map[string][]string, error) {
|
||||||
dnsNetblock := dnsNetblockList[0]
|
dnsNetblock := dnsNetblockList[0]
|
||||||
|
|
||||||
dnsNetblockList[0] = ""
|
dnsNetblockList[0] = ""
|
||||||
dnsNetblockList = dnsNetblockList[1:len(dnsNetblockList)]
|
dnsNetblockList = dnsNetblockList[1:]
|
||||||
|
|
||||||
response, err = netblock_request(dnsNetblock)
|
response, err = netblock_request(dnsNetblock)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ func TestAccDataSourceGoogleNetblockIpRanges_basic(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccNetblockIpRangesConfig,
|
Config: testAccNetblockIpRangesConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
resource.TestMatchResourceAttr("data.google_netblock_ip_ranges.some",
|
resource.TestMatchResourceAttr("data.google_netblock_ip_ranges.some",
|
||||||
|
|
|
@ -11,28 +11,28 @@ func dataSourceGoogleServiceAccount() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
Read: dataSourceGoogleServiceAccountRead,
|
Read: dataSourceGoogleServiceAccountRead,
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"account_id": &schema.Schema{
|
"account_id": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validateRFC1035Name(6, 30),
|
ValidateFunc: validateRFC1035Name(6, 30),
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"email": &schema.Schema{
|
"email": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"unique_id": &schema.Schema{
|
"unique_id": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"display_name": &schema.Schema{
|
"display_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -36,46 +36,46 @@ func dataSourceGoogleSignedUrl() *schema.Resource {
|
||||||
Read: dataSourceGoogleSignedUrlRead,
|
Read: dataSourceGoogleSignedUrlRead,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"bucket": &schema.Schema{
|
"bucket": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"content_md5": &schema.Schema{
|
"content_md5": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "",
|
Default: "",
|
||||||
},
|
},
|
||||||
"content_type": &schema.Schema{
|
"content_type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "",
|
Default: "",
|
||||||
},
|
},
|
||||||
"credentials": &schema.Schema{
|
"credentials": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"duration": &schema.Schema{
|
"duration": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "1h",
|
Default: "1h",
|
||||||
},
|
},
|
||||||
"extension_headers": &schema.Schema{
|
"extension_headers": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
ValidateFunc: validateExtensionHeaders,
|
ValidateFunc: validateExtensionHeaders,
|
||||||
},
|
},
|
||||||
"http_method": &schema.Schema{
|
"http_method": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "GET",
|
Default: "GET",
|
||||||
ValidateFunc: validation.StringInSlice([]string{"GET", "HEAD", "PUT", "DELETE"}, true),
|
ValidateFunc: validation.StringInSlice([]string{"GET", "HEAD", "PUT", "DELETE"}, true),
|
||||||
},
|
},
|
||||||
"path": &schema.Schema{
|
"path": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"signed_url": &schema.Schema{
|
"signed_url": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
@ -85,7 +85,7 @@ func dataSourceGoogleSignedUrl() *schema.Resource {
|
||||||
|
|
||||||
func validateExtensionHeaders(v interface{}, k string) (ws []string, errors []error) {
|
func validateExtensionHeaders(v interface{}, k string) (ws []string, errors []error) {
|
||||||
hdrMap := v.(map[string]interface{})
|
hdrMap := v.(map[string]interface{})
|
||||||
for k, _ := range hdrMap {
|
for k := range hdrMap {
|
||||||
if !strings.HasPrefix(strings.ToLower(k), "x-goog-") {
|
if !strings.HasPrefix(strings.ToLower(k), "x-goog-") {
|
||||||
errors = append(errors, fmt.Errorf(
|
errors = append(errors, fmt.Errorf(
|
||||||
"extension_header (%s) not valid, header name must begin with 'x-goog-'", k))
|
"extension_header (%s) not valid, header name must begin with 'x-goog-'", k))
|
||||||
|
|
|
@ -106,7 +106,7 @@ func TestAccStorageSignedUrl_basic(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleSignedUrlConfig,
|
Config: testGoogleSignedUrlConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccSignedUrlExists("data.google_storage_object_signed_url.blerg"),
|
testAccSignedUrlExists("data.google_storage_object_signed_url.blerg"),
|
||||||
|
@ -130,7 +130,7 @@ func TestAccStorageSignedUrl_accTest(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccTestGoogleStorageObjectSignedURL(bucketName),
|
Config: testAccTestGoogleStorageObjectSignedURL(bucketName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccSignedUrlRetrieval("data.google_storage_object_signed_url.story_url", nil),
|
testAccSignedUrlRetrieval("data.google_storage_object_signed_url.story_url", nil),
|
||||||
|
|
|
@ -9,13 +9,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var IamPubsubSubscriptionSchema = map[string]*schema.Schema{
|
var IamPubsubSubscriptionSchema = map[string]*schema.Schema{
|
||||||
"subscription": &schema.Schema{
|
"subscription": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -10,13 +10,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var IamPubsubTopicSchema = map[string]*schema.Schema{
|
var IamPubsubTopicSchema = map[string]*schema.Schema{
|
||||||
"topic": &schema.Schema{
|
"topic": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var IamServiceAccountSchema = map[string]*schema.Schema{
|
var IamServiceAccountSchema = map[string]*schema.Schema{
|
||||||
"service_account_id": &schema.Schema{
|
"service_account_id": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var IamStorageBucketSchema = map[string]*schema.Schema{
|
var IamStorageBucketSchema = map[string]*schema.Schema{
|
||||||
"bucket": &schema.Schema{
|
"bucket": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -43,19 +43,19 @@ var schemaNodeConfig = &schema.Schema{
|
||||||
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"guest_accelerator": &schema.Schema{
|
"guest_accelerator": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"count": &schema.Schema{
|
"count": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -17,7 +17,7 @@ var mutexKV = mutexkv.NewMutexKV()
|
||||||
func Provider() terraform.ResourceProvider {
|
func Provider() terraform.ResourceProvider {
|
||||||
return &schema.Provider{
|
return &schema.Provider{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"credentials": &schema.Schema{
|
"credentials": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
||||||
|
@ -28,7 +28,7 @@ func Provider() terraform.ResourceProvider {
|
||||||
ValidateFunc: validateCredentials,
|
ValidateFunc: validateCredentials,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
||||||
|
@ -39,7 +39,7 @@ func Provider() terraform.ResourceProvider {
|
||||||
}, nil),
|
}, nil),
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
||||||
|
@ -49,7 +49,7 @@ func Provider() terraform.ResourceProvider {
|
||||||
}, nil),
|
}, nil),
|
||||||
},
|
},
|
||||||
|
|
||||||
"zone": &schema.Schema{
|
"zone": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
||||||
|
|
|
@ -26,19 +26,19 @@ func resourceAppEngineApplication() *schema.Resource {
|
||||||
),
|
),
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateProjectID(),
|
ValidateFunc: validateProjectID(),
|
||||||
},
|
},
|
||||||
"auth_domain": &schema.Schema{
|
"auth_domain": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"location_id": &schema.Schema{
|
"location_id": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{
|
ValidateFunc: validation.StringInSlice([]string{
|
||||||
|
@ -56,7 +56,7 @@ func resourceAppEngineApplication() *schema.Resource {
|
||||||
"australia-southeast1",
|
"australia-southeast1",
|
||||||
}, false),
|
}, false),
|
||||||
},
|
},
|
||||||
"serving_status": &schema.Schema{
|
"serving_status": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{
|
ValidateFunc: validation.StringInSlice([]string{
|
||||||
|
@ -67,35 +67,35 @@ func resourceAppEngineApplication() *schema.Resource {
|
||||||
}, false),
|
}, false),
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"feature_settings": &schema.Schema{
|
"feature_settings": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: appEngineApplicationFeatureSettingsResource(),
|
Elem: appEngineApplicationFeatureSettingsResource(),
|
||||||
},
|
},
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"url_dispatch_rule": &schema.Schema{
|
"url_dispatch_rule": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Elem: appEngineApplicationURLDispatchRuleResource(),
|
Elem: appEngineApplicationURLDispatchRuleResource(),
|
||||||
},
|
},
|
||||||
"code_bucket": &schema.Schema{
|
"code_bucket": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"default_hostname": &schema.Schema{
|
"default_hostname": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"default_bucket": &schema.Schema{
|
"default_bucket": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"gcr_domain": &schema.Schema{
|
"gcr_domain": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
@ -106,15 +106,15 @@ func resourceAppEngineApplication() *schema.Resource {
|
||||||
func appEngineApplicationURLDispatchRuleResource() *schema.Resource {
|
func appEngineApplicationURLDispatchRuleResource() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"domain": &schema.Schema{
|
"domain": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"path": &schema.Schema{
|
"path": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"service": &schema.Schema{
|
"service": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
@ -125,7 +125,7 @@ func appEngineApplicationURLDispatchRuleResource() *schema.Resource {
|
||||||
func appEngineApplicationFeatureSettingsResource() *schema.Resource {
|
func appEngineApplicationFeatureSettingsResource() *schema.Resource {
|
||||||
return &schema.Resource{
|
return &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"split_health_checks": &schema.Schema{
|
"split_health_checks": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -121,7 +121,7 @@ func resourceBigQueryDataset() *schema.Resource {
|
||||||
// Labels: [Experimental] The labels associated with this dataset. You
|
// Labels: [Experimental] The labels associated with this dataset. You
|
||||||
// can use these to organize and group your datasets. You can set this
|
// can use these to organize and group your datasets. You can set this
|
||||||
// property when inserting or updating a dataset.
|
// property when inserting or updating a dataset.
|
||||||
"labels": &schema.Schema{
|
"labels": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
|
@ -131,35 +131,35 @@ func resourceBigQueryDataset() *schema.Resource {
|
||||||
// for one or more entities. You can set this property when inserting
|
// for one or more entities. You can set this property when inserting
|
||||||
// or updating a dataset in order to control who is allowed to access
|
// or updating a dataset in order to control who is allowed to access
|
||||||
// the data.
|
// the data.
|
||||||
"access": &schema.Schema{
|
"access": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
// Computed because if unset, BQ adds 4 entries automatically
|
// Computed because if unset, BQ adds 4 entries automatically
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"role": &schema.Schema{
|
"role": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"OWNER", "WRITER", "READER"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"OWNER", "WRITER", "READER"}, false),
|
||||||
},
|
},
|
||||||
"domain": &schema.Schema{
|
"domain": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"group_by_email": &schema.Schema{
|
"group_by_email": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"special_group": &schema.Schema{
|
"special_group": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"user_by_email": &schema.Schema{
|
"user_by_email": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"view": &schema.Schema{
|
"view": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
|
|
|
@ -75,7 +75,7 @@ func resourceBigQueryTable() *schema.Resource {
|
||||||
// characters are allowed. Label values are optional. Label keys must
|
// characters are allowed. Label values are optional. Label keys must
|
||||||
// start with a letter and each label in the list must have a different
|
// start with a letter and each label in the list must have a different
|
||||||
// key.
|
// key.
|
||||||
"labels": &schema.Schema{
|
"labels": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
|
@ -94,7 +94,7 @@ func resourceBigQueryTable() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
// View: [Optional] If specified, configures this table as a view.
|
// View: [Optional] If specified, configures this table as a view.
|
||||||
"view": &schema.Schema{
|
"view": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
|
@ -121,7 +121,7 @@ func resourceBigQueryTable() *schema.Resource {
|
||||||
|
|
||||||
// TimePartitioning: [Experimental] If specified, configures time-based
|
// TimePartitioning: [Experimental] If specified, configures time-based
|
||||||
// partitioning for this table.
|
// partitioning for this table.
|
||||||
"time_partitioning": &schema.Schema{
|
"time_partitioning": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
|
|
|
@ -31,13 +31,13 @@ func resourceCloudBuildTrigger() *schema.Resource {
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 1,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"filename": &schema.Schema{
|
"filename": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ConflictsWith: []string{"build"},
|
ConflictsWith: []string{"build"},
|
||||||
|
@ -49,28 +49,28 @@ func resourceCloudBuildTrigger() *schema.Resource {
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"images": &schema.Schema{
|
"images": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
"step": &schema.Schema{
|
"step": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"args": &schema.Schema{
|
"args": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"tags": &schema.Schema{
|
"tags": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
|
@ -78,56 +78,56 @@ func resourceCloudBuildTrigger() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"substitutions": &schema.Schema{
|
"substitutions": {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
"included_files": &schema.Schema{
|
"included_files": {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
MaxItems: 50,
|
MaxItems: 50,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
"ignored_files": &schema.Schema{
|
"ignored_files": {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
MaxItems: 50,
|
MaxItems: 50,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
"trigger_template": &schema.Schema{
|
"trigger_template": {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"branch_name": &schema.Schema{
|
"branch_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"commit_sha": &schema.Schema{
|
"commit_sha": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"dir": &schema.Schema{
|
"dir": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"repo_name": &schema.Schema{
|
"repo_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"tag_name": &schema.Schema{
|
"tag_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,28 +22,28 @@ func TestAccCloudBuildTrigger_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckGoogleCloudBuildTriggerVersionsDestroyed,
|
CheckDestroy: testAccCheckGoogleCloudBuildTriggerVersionsDestroyed,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_basic(projectID, projectOrg, projectBillingAccount),
|
Config: testGoogleCloudBuildTrigger_basic(projectID, projectOrg, projectBillingAccount),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckGoogleCloudBuildTriggerExists("google_cloudbuild_trigger.build_trigger"),
|
testAccCheckGoogleCloudBuildTriggerExists("google_cloudbuild_trigger.build_trigger"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
ImportStateIdPrefix: fmt.Sprintf("%s/", projectID),
|
ImportStateIdPrefix: fmt.Sprintf("%s/", projectID),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_updated(projectID, projectOrg, projectBillingAccount),
|
Config: testGoogleCloudBuildTrigger_updated(projectID, projectOrg, projectBillingAccount),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
ResourceName: "google_cloudbuild_trigger.build_trigger",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
ImportStateIdPrefix: fmt.Sprintf("%s/", projectID),
|
ImportStateIdPrefix: fmt.Sprintf("%s/", projectID),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_removed(projectID, projectOrg, projectBillingAccount),
|
Config: testGoogleCloudBuildTrigger_removed(projectID, projectOrg, projectBillingAccount),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckGoogleCloudBuildTriggerWasRemovedFromState("google_cloudbuild_trigger.build_trigger"),
|
testAccCheckGoogleCloudBuildTriggerWasRemovedFromState("google_cloudbuild_trigger.build_trigger"),
|
||||||
|
@ -65,13 +65,13 @@ func TestAccCloudBuildTrigger_filename(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckGoogleCloudBuildTriggerVersionsDestroyed,
|
CheckDestroy: testAccCheckGoogleCloudBuildTriggerVersionsDestroyed,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_filename(projectID, projectOrg, projectBillingAccount),
|
Config: testGoogleCloudBuildTrigger_filename(projectID, projectOrg, projectBillingAccount),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckGoogleCloudFilenameConfig("google_cloudbuild_trigger.filename_build_trigger"),
|
testAccCheckGoogleCloudFilenameConfig("google_cloudbuild_trigger.filename_build_trigger"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testGoogleCloudBuildTrigger_removed(projectID, projectOrg, projectBillingAccount),
|
Config: testGoogleCloudBuildTrigger_removed(projectID, projectOrg, projectBillingAccount),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckGoogleCloudBuildTriggerWasRemovedFromState("google_cloudbuild_trigger.filename_build_trigger"),
|
testAccCheckGoogleCloudBuildTriggerWasRemovedFromState("google_cloudbuild_trigger.filename_build_trigger"),
|
||||||
|
|
|
@ -30,30 +30,30 @@ func resourceCloudIoTRegistry() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateCloudIoTID,
|
ValidateFunc: validateCloudIoTID,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"event_notification_config": &schema.Schema{
|
"event_notification_config": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"pubsub_topic_name": &schema.Schema{
|
"pubsub_topic_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
|
@ -61,12 +61,12 @@ func resourceCloudIoTRegistry() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"state_notification_config": &schema.Schema{
|
"state_notification_config": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"pubsub_topic_name": &schema.Schema{
|
"pubsub_topic_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
|
@ -74,13 +74,13 @@ func resourceCloudIoTRegistry() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"mqtt_config": &schema.Schema{
|
"mqtt_config": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"mqtt_enabled_state": &schema.Schema{
|
"mqtt_enabled_state": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validation.StringInSlice(
|
ValidateFunc: validation.StringInSlice(
|
||||||
|
@ -89,13 +89,13 @@ func resourceCloudIoTRegistry() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"http_config": &schema.Schema{
|
"http_config": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"http_enabled_state": &schema.Schema{
|
"http_enabled_state": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validation.StringInSlice(
|
ValidateFunc: validation.StringInSlice(
|
||||||
|
@ -104,24 +104,24 @@ func resourceCloudIoTRegistry() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"credentials": &schema.Schema{
|
"credentials": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 10,
|
MaxItems: 10,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"public_key_certificate": &schema.Schema{
|
"public_key_certificate": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"format": &schema.Schema{
|
"format": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validation.StringInSlice(
|
ValidateFunc: validation.StringInSlice(
|
||||||
[]string{x509CertificatePEM}, false),
|
[]string{x509CertificatePEM}, false),
|
||||||
},
|
},
|
||||||
"certificate": &schema.Schema{
|
"certificate": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,7 @@ func TestAccCloudIoTRegistry_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckCloudIoTRegistryDestroy,
|
CheckDestroy: testAccCheckCloudIoTRegistryDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccCloudIoTRegistry_basic(registryName),
|
Config: testAccCloudIoTRegistry_basic(registryName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCloudIoTRegistryExists(
|
testAccCloudIoTRegistryExists(
|
||||||
|
@ -45,7 +45,7 @@ func TestAccCloudIoTRegistry_extended(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckCloudIoTRegistryDestroy,
|
CheckDestroy: testAccCheckCloudIoTRegistryDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccCloudIoTRegistry_extended(registryName),
|
Config: testAccCloudIoTRegistry_extended(registryName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCloudIoTRegistryExists(
|
testAccCloudIoTRegistryExists(
|
||||||
|
@ -71,17 +71,17 @@ func TestAccCloudIoTRegistry_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckCloudIoTRegistryDestroy,
|
CheckDestroy: testAccCheckCloudIoTRegistryDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccCloudIoTRegistry_basic(registryName),
|
Config: testAccCloudIoTRegistry_basic(registryName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCloudIoTRegistryExists(
|
testAccCloudIoTRegistryExists(
|
||||||
"google_cloudiot_registry.foobar"),
|
"google_cloudiot_registry.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccCloudIoTRegistry_extended(registryName),
|
Config: testAccCloudIoTRegistry_extended(registryName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccCloudIoTRegistry_basic(registryName),
|
Config: testAccCloudIoTRegistry_basic(registryName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,10 +16,10 @@ func TestAccComputeAddress_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeAddressDestroy,
|
CheckDestroy: testAccCheckComputeAddressDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAddress_basic(acctest.RandString(10)),
|
Config: testAccComputeAddress_basic(acctest.RandString(10)),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_address.foobar",
|
ResourceName: "google_compute_address.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -36,10 +36,10 @@ func TestAccComputeAddress_networkTier(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeAddressDestroy,
|
CheckDestroy: testAccCheckComputeAddressDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAddress_networkTier(acctest.RandString(10)),
|
Config: testAccComputeAddress_networkTier(acctest.RandString(10)),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_address.foobar",
|
ResourceName: "google_compute_address.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -54,22 +54,22 @@ func TestAccComputeAddress_internal(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeAddressDestroy,
|
CheckDestroy: testAccCheckComputeAddressDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAddress_internal(acctest.RandString(10)),
|
Config: testAccComputeAddress_internal(acctest.RandString(10)),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_address.internal",
|
ResourceName: "google_compute_address.internal",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_address.internal_with_subnet",
|
ResourceName: "google_compute_address.internal_with_subnet",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_address.internal_with_subnet_and_address",
|
ResourceName: "google_compute_address.internal_with_subnet_and_address",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -22,16 +22,16 @@ func TestAccComputeAttachedDisk_basic(t *testing.T) {
|
||||||
// Check destroy isn't a good test here, see comment on testCheckAttachedDiskIsNowDetached
|
// Check destroy isn't a good test here, see comment on testCheckAttachedDiskIsNowDetached
|
||||||
CheckDestroy: nil,
|
CheckDestroy: nil,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAttachedDiskResource(diskName, instanceName) + testAttachedDiskResourceAttachment(),
|
Config: testAttachedDiskResource(diskName, instanceName) + testAttachedDiskResourceAttachment(),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_attached_disk.test",
|
ResourceName: "google_compute_attached_disk.test",
|
||||||
ImportStateId: importID,
|
ImportStateId: importID,
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAttachedDiskResource(diskName, instanceName),
|
Config: testAttachedDiskResource(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testCheckAttachedDiskIsNowDetached(instanceName, diskName),
|
testCheckAttachedDiskIsNowDetached(instanceName, diskName),
|
||||||
|
@ -54,10 +54,10 @@ func TestAccComputeAttachedDisk_full(t *testing.T) {
|
||||||
// Check destroy isn't a good test here, see comment on testCheckAttachedDiskIsNowDetached
|
// Check destroy isn't a good test here, see comment on testCheckAttachedDiskIsNowDetached
|
||||||
CheckDestroy: nil,
|
CheckDestroy: nil,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAttachedDiskResource(diskName, instanceName) + testAttachedDiskResourceAttachmentFull(),
|
Config: testAttachedDiskResource(diskName, instanceName) + testAttachedDiskResourceAttachmentFull(),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_attached_disk.test",
|
ResourceName: "google_compute_attached_disk.test",
|
||||||
ImportStateId: importID,
|
ImportStateId: importID,
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
|
@ -81,10 +81,10 @@ func TestAccComputeAttachedDisk_region(t *testing.T) {
|
||||||
// Check destroy isn't a good test here, see comment on testCheckAttachedDiskIsNowDetached
|
// Check destroy isn't a good test here, see comment on testCheckAttachedDiskIsNowDetached
|
||||||
CheckDestroy: nil,
|
CheckDestroy: nil,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAttachedDiskResource_region(diskName, instanceName),
|
Config: testAttachedDiskResource_region(diskName, instanceName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_attached_disk.test",
|
ResourceName: "google_compute_attached_disk.test",
|
||||||
ImportStateId: importID,
|
ImportStateId: importID,
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
|
@ -107,7 +107,7 @@ func TestAccComputeAttachedDisk_count(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: nil,
|
CheckDestroy: nil,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAttachedDiskResourceCount(diskPrefix, instanceName, count),
|
Config: testAttachedDiskResourceCount(diskPrefix, instanceName, count),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testCheckAttachedDiskContainsManyDisks(instanceName, count),
|
testCheckAttachedDiskContainsManyDisks(instanceName, count),
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestAccComputeAutoscaler_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
|
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeAutoscalerExists(
|
testAccCheckComputeAutoscalerExists(
|
||||||
|
@ -34,7 +34,7 @@ func TestAccComputeAutoscaler_basic(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_autoscaler.foobar",
|
ResourceName: "google_compute_autoscaler.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -58,14 +58,14 @@ func TestAccComputeAutoscaler_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
|
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeAutoscalerExists(
|
testAccCheckComputeAutoscalerExists(
|
||||||
"google_compute_autoscaler.foobar", &ascaler),
|
"google_compute_autoscaler.foobar", &ascaler),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAutoscaler_update(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeAutoscaler_update(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeAutoscalerExists(
|
testAccCheckComputeAutoscalerExists(
|
||||||
|
@ -91,11 +91,11 @@ func TestAccComputeAutoscaler_multicondition(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
|
CheckDestroy: testAccCheckComputeAutoscalerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeAutoscaler_multicondition(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeAutoscaler_multicondition(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: testAccCheckComputeAutoscalerMultifunction("google_compute_autoscaler.foobar"),
|
Check: testAccCheckComputeAutoscalerMultifunction("google_compute_autoscaler.foobar"),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_autoscaler.foobar",
|
ResourceName: "google_compute_autoscaler.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -22,14 +22,14 @@ func TestAccComputeBackendBucket_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendBucketDestroy,
|
CheckDestroy: testAccCheckComputeBackendBucketDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendBucket_basic(backendName, storageName),
|
Config: testAccComputeBackendBucket_basic(backendName, storageName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendBucketExists(
|
testAccCheckComputeBackendBucketExists(
|
||||||
"google_compute_backend_bucket.foobar", &svc),
|
"google_compute_backend_bucket.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_bucket.foobar",
|
ResourceName: "google_compute_backend_bucket.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -55,14 +55,14 @@ func TestAccComputeBackendBucket_basicModified(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendBucketDestroy,
|
CheckDestroy: testAccCheckComputeBackendBucketDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendBucket_basic(backendName, storageName),
|
Config: testAccComputeBackendBucket_basic(backendName, storageName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendBucketExists(
|
testAccCheckComputeBackendBucketExists(
|
||||||
"google_compute_backend_bucket.foobar", &svc),
|
"google_compute_backend_bucket.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendBucket_basicModified(
|
Config: testAccComputeBackendBucket_basicModified(
|
||||||
backendName, storageName, secondStorageName),
|
backendName, storageName, secondStorageName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -119,7 +119,7 @@ func TestAccComputeBackendBucket_withCdnEnabled(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendBucketDestroy,
|
CheckDestroy: testAccCheckComputeBackendBucketDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendBucket_withCdnEnabled(
|
Config: testAccComputeBackendBucket_withCdnEnabled(
|
||||||
backendName, storageName),
|
backendName, storageName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
|
|
@ -23,14 +23,14 @@ func resourceComputeBackendService() *schema.Resource {
|
||||||
SchemaVersion: 1,
|
SchemaVersion: 1,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateGCPName,
|
ValidateFunc: validateGCPName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"health_checks": &schema.Schema{
|
"health_checks": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
Set: selfLinkRelativePathHash,
|
Set: selfLinkRelativePathHash,
|
||||||
|
@ -39,17 +39,17 @@ func resourceComputeBackendService() *schema.Resource {
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
"iap": &schema.Schema{
|
"iap": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"oauth2_client_id": &schema.Schema{
|
"oauth2_client_id": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
"oauth2_client_secret": &schema.Schema{
|
"oauth2_client_secret": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
|
@ -64,48 +64,48 @@ func resourceComputeBackendService() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"backend": &schema.Schema{
|
"backend": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Set: resourceGoogleComputeBackendServiceBackendHash,
|
Set: resourceGoogleComputeBackendServiceBackendHash,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"group": &schema.Schema{
|
"group": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
"balancing_mode": &schema.Schema{
|
"balancing_mode": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "UTILIZATION",
|
Default: "UTILIZATION",
|
||||||
},
|
},
|
||||||
"capacity_scaler": &schema.Schema{
|
"capacity_scaler": {
|
||||||
Type: schema.TypeFloat,
|
Type: schema.TypeFloat,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: 1,
|
Default: 1,
|
||||||
},
|
},
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"max_rate": &schema.Schema{
|
"max_rate": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"max_rate_per_instance": &schema.Schema{
|
"max_rate_per_instance": {
|
||||||
Type: schema.TypeFloat,
|
Type: schema.TypeFloat,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"max_connections": &schema.Schema{
|
"max_connections": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"max_connections_per_instance": &schema.Schema{
|
"max_connections_per_instance": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"max_utilization": &schema.Schema{
|
"max_utilization": {
|
||||||
Type: schema.TypeFloat,
|
Type: schema.TypeFloat,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: 0.8,
|
Default: 0.8,
|
||||||
|
@ -114,38 +114,38 @@ func resourceComputeBackendService() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"cdn_policy": &schema.Schema{
|
"cdn_policy": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"cache_key_policy": &schema.Schema{
|
"cache_key_policy": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"include_host": &schema.Schema{
|
"include_host": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"include_protocol": &schema.Schema{
|
"include_protocol": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"include_query_string": &schema.Schema{
|
"include_query_string": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
"query_string_blacklist": &schema.Schema{
|
"query_string_blacklist": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
ConflictsWith: []string{"cdn_policy.0.cache_key_policy.query_string_whitelist"},
|
ConflictsWith: []string{"cdn_policy.0.cache_key_policy.query_string_whitelist"},
|
||||||
},
|
},
|
||||||
"query_string_whitelist": &schema.Schema{
|
"query_string_whitelist": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
|
@ -158,7 +158,7 @@ func resourceComputeBackendService() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"custom_request_headers": &schema.Schema{
|
"custom_request_headers": {
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -166,72 +166,72 @@ func resourceComputeBackendService() *schema.Resource {
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"enable_cdn": &schema.Schema{
|
"enable_cdn": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
"fingerprint": &schema.Schema{
|
"fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"port_name": &schema.Schema{
|
"port_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"protocol": &schema.Schema{
|
"protocol": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Removed: "region has been removed as it was never used. For internal load balancing, use google_compute_region_backend_service",
|
Removed: "region has been removed as it was never used. For internal load balancing, use google_compute_region_backend_service",
|
||||||
},
|
},
|
||||||
|
|
||||||
"security_policy": &schema.Schema{
|
"security_policy": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"session_affinity": &schema.Schema{
|
"session_affinity": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"timeout_sec": &schema.Schema{
|
"timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"connection_draining_timeout_sec": &schema.Schema{
|
"connection_draining_timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: 300,
|
Default: 300,
|
||||||
|
|
|
@ -24,14 +24,14 @@ func TestAccComputeBackendService_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_basic(serviceName, checkName),
|
Config: testAccComputeBackendService_basic(serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_basicModified(
|
Config: testAccComputeBackendService_basicModified(
|
||||||
serviceName, checkName, extraCheckName),
|
serviceName, checkName, extraCheckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -39,7 +39,7 @@ func TestAccComputeBackendService_basic(t *testing.T) {
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.foobar",
|
ResourceName: "google_compute_backend_service.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -61,7 +61,7 @@ func TestAccComputeBackendService_withBackend(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withBackend(
|
Config: testAccComputeBackendService_withBackend(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -69,7 +69,7 @@ func TestAccComputeBackendService_withBackend(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withBackend(
|
Config: testAccComputeBackendService_withBackend(
|
||||||
serviceName, igName, itName, checkName, 20),
|
serviceName, igName, itName, checkName, 20),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -77,7 +77,7 @@ func TestAccComputeBackendService_withBackend(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.lipsum",
|
ResourceName: "google_compute_backend_service.lipsum",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -107,7 +107,7 @@ func TestAccComputeBackendService_withBackendAndIAP(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withBackendAndIAP(
|
Config: testAccComputeBackendService_withBackendAndIAP(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -115,12 +115,12 @@ func TestAccComputeBackendService_withBackendAndIAP(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.lipsum",
|
ResourceName: "google_compute_backend_service.lipsum",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withBackend(
|
Config: testAccComputeBackendService_withBackend(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -155,7 +155,7 @@ func TestAccComputeBackendService_updatePreservesOptionalParameters(t *testing.T
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withSessionAffinity(
|
Config: testAccComputeBackendService_withSessionAffinity(
|
||||||
serviceName, checkName, "initial-description", "GENERATED_COOKIE"),
|
serviceName, checkName, "initial-description", "GENERATED_COOKIE"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -163,7 +163,7 @@ func TestAccComputeBackendService_updatePreservesOptionalParameters(t *testing.T
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withSessionAffinity(
|
Config: testAccComputeBackendService_withSessionAffinity(
|
||||||
serviceName, checkName, "updated-description", "GENERATED_COOKIE"),
|
serviceName, checkName, "updated-description", "GENERATED_COOKIE"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -191,14 +191,14 @@ func TestAccComputeBackendService_withConnectionDraining(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withConnectionDraining(serviceName, checkName, 10),
|
Config: testAccComputeBackendService_withConnectionDraining(serviceName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.foobar",
|
ResourceName: "google_compute_backend_service.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -223,14 +223,14 @@ func TestAccComputeBackendService_withConnectionDrainingAndUpdate(t *testing.T)
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withConnectionDraining(serviceName, checkName, 10),
|
Config: testAccComputeBackendService_withConnectionDraining(serviceName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_basic(serviceName, checkName),
|
Config: testAccComputeBackendService_basic(serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
|
@ -257,14 +257,14 @@ func TestAccComputeBackendService_withHttpsHealthCheck(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withHttpsHealthCheck(serviceName, checkName),
|
Config: testAccComputeBackendService_withHttpsHealthCheck(serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.foobar",
|
ResourceName: "google_compute_backend_service.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -285,14 +285,14 @@ func TestAccComputeBackendService_withCdnPolicy(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withCdnPolicy(serviceName, checkName),
|
Config: testAccComputeBackendService_withCdnPolicy(serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.foobar",
|
ResourceName: "google_compute_backend_service.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -314,7 +314,7 @@ func TestAccComputeBackendService_withSecurityPolicy(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withSecurityPolicy(serviceName, checkName, polName),
|
Config: testAccComputeBackendService_withSecurityPolicy(serviceName, checkName, polName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBackendServiceExists(
|
testAccCheckComputeBackendServiceExists(
|
||||||
|
@ -450,7 +450,7 @@ func TestAccComputeBackendService_withCDNEnabled(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withCDNEnabled(
|
Config: testAccComputeBackendService_withCDNEnabled(
|
||||||
serviceName, checkName),
|
serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -478,7 +478,7 @@ func TestAccComputeBackendService_withSessionAffinity(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withSessionAffinity(
|
Config: testAccComputeBackendService_withSessionAffinity(
|
||||||
serviceName, checkName, "description", "CLIENT_IP"),
|
serviceName, checkName, "description", "CLIENT_IP"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -486,7 +486,7 @@ func TestAccComputeBackendService_withSessionAffinity(t *testing.T) {
|
||||||
"google_compute_backend_service.foobar", &svc),
|
"google_compute_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withSessionAffinity(
|
Config: testAccComputeBackendService_withSessionAffinity(
|
||||||
serviceName, checkName, "description", "GENERATED_COOKIE"),
|
serviceName, checkName, "description", "GENERATED_COOKIE"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -516,7 +516,7 @@ func TestAccComputeBackendService_withMaxConnections(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withMaxConnections(
|
Config: testAccComputeBackendService_withMaxConnections(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -524,7 +524,7 @@ func TestAccComputeBackendService_withMaxConnections(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withMaxConnections(
|
Config: testAccComputeBackendService_withMaxConnections(
|
||||||
serviceName, igName, itName, checkName, 20),
|
serviceName, igName, itName, checkName, 20),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -532,7 +532,7 @@ func TestAccComputeBackendService_withMaxConnections(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.lipsum",
|
ResourceName: "google_compute_backend_service.lipsum",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -559,7 +559,7 @@ func TestAccComputeBackendService_withMaxConnectionsPerInstance(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withMaxConnectionsPerInstance(
|
Config: testAccComputeBackendService_withMaxConnectionsPerInstance(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -567,7 +567,7 @@ func TestAccComputeBackendService_withMaxConnectionsPerInstance(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeBackendService_withMaxConnectionsPerInstance(
|
Config: testAccComputeBackendService_withMaxConnectionsPerInstance(
|
||||||
serviceName, igName, itName, checkName, 20),
|
serviceName, igName, itName, checkName, 20),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -575,7 +575,7 @@ func TestAccComputeBackendService_withMaxConnectionsPerInstance(t *testing.T) {
|
||||||
"google_compute_backend_service.lipsum", &svc),
|
"google_compute_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_backend_service.lipsum",
|
ResourceName: "google_compute_backend_service.lipsum",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -388,7 +388,7 @@ func resourceComputeDisk() *schema.Resource {
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"disk_encryption_key_raw": &schema.Schema{
|
"disk_encryption_key_raw": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -396,7 +396,7 @@ func resourceComputeDisk() *schema.Resource {
|
||||||
Removed: "Use disk_encryption_key.raw_key instead.",
|
Removed: "Use disk_encryption_key.raw_key instead.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_sha256": &schema.Schema{
|
"disk_encryption_key_sha256": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "Use disk_encryption_key.sha256 instead.",
|
Removed: "Use disk_encryption_key.sha256 instead.",
|
||||||
|
|
|
@ -216,7 +216,7 @@ func TestAccComputeDisk_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeDiskDestroy,
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_basic(diskName),
|
Config: testAccComputeDisk_basic(diskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -225,7 +225,7 @@ func TestAccComputeDisk_basic(t *testing.T) {
|
||||||
testAccCheckComputeDiskHasLabelFingerprint(&disk, "google_compute_disk.foobar"),
|
testAccCheckComputeDiskHasLabelFingerprint(&disk, "google_compute_disk.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_disk.foobar",
|
ResourceName: "google_compute_disk.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -242,7 +242,7 @@ func TestAccComputeDisk_timeout(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_timeout(diskName),
|
Config: testAccComputeDisk_timeout(diskName),
|
||||||
ExpectError: regexp.MustCompile("timeout"),
|
ExpectError: regexp.MustCompile("timeout"),
|
||||||
},
|
},
|
||||||
|
@ -300,14 +300,14 @@ func TestAccComputeDisk_fromSnapshot(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeDiskDestroy,
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_fromSnapshot(projectName, firstDiskName, snapshotName, diskName, "self_link"),
|
Config: testAccComputeDisk_fromSnapshot(projectName, firstDiskName, snapshotName, diskName, "self_link"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
"google_compute_disk.seconddisk", getTestProjectFromEnv(), &disk),
|
"google_compute_disk.seconddisk", getTestProjectFromEnv(), &disk),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_fromSnapshot(projectName, firstDiskName, snapshotName, diskName, "name"),
|
Config: testAccComputeDisk_fromSnapshot(projectName, firstDiskName, snapshotName, diskName, "name"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -329,7 +329,7 @@ func TestAccComputeDisk_encryption(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeDiskDestroy,
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_encryption(diskName),
|
Config: testAccComputeDisk_encryption(diskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -354,7 +354,7 @@ func TestAccComputeDisk_deleteDetach(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeDiskDestroy,
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_deleteDetach(instanceName, diskName),
|
Config: testAccComputeDisk_deleteDetach(instanceName, diskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -365,7 +365,7 @@ func TestAccComputeDisk_deleteDetach(t *testing.T) {
|
||||||
// listed as attached to the disk; the instance is created after the
|
// listed as attached to the disk; the instance is created after the
|
||||||
// disk. and the disk's properties aren't refreshed unless there's
|
// disk. and the disk's properties aren't refreshed unless there's
|
||||||
// another step
|
// another step
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_deleteDetach(instanceName, diskName),
|
Config: testAccComputeDisk_deleteDetach(instanceName, diskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -391,7 +391,7 @@ func TestAccComputeDisk_deleteDetachIGM(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeDiskDestroy,
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_deleteDetachIGM(diskName, mgrName),
|
Config: testAccComputeDisk_deleteDetachIGM(diskName, mgrName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -402,7 +402,7 @@ func TestAccComputeDisk_deleteDetachIGM(t *testing.T) {
|
||||||
// listed as attached to the disk; the instance is created after the
|
// listed as attached to the disk; the instance is created after the
|
||||||
// disk. and the disk's properties aren't refreshed unless there's
|
// disk. and the disk's properties aren't refreshed unless there's
|
||||||
// another step
|
// another step
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_deleteDetachIGM(diskName, mgrName),
|
Config: testAccComputeDisk_deleteDetachIGM(diskName, mgrName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -412,7 +412,7 @@ func TestAccComputeDisk_deleteDetachIGM(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// Change the disk name to recreate the instances
|
// Change the disk name to recreate the instances
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_deleteDetachIGM(diskName2, mgrName),
|
Config: testAccComputeDisk_deleteDetachIGM(diskName2, mgrName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
@ -420,7 +420,7 @@ func TestAccComputeDisk_deleteDetachIGM(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// Add the extra step like before
|
// Add the extra step like before
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeDisk_deleteDetachIGM(diskName2, mgrName),
|
Config: testAccComputeDisk_deleteDetachIGM(diskName2, mgrName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
|
|
|
@ -36,7 +36,7 @@ func migrateFirewallStateV0toV1(is *terraform.InstanceState) (*terraform.Instanc
|
||||||
portCount := 0
|
portCount := 0
|
||||||
newPorts := make(map[string]string)
|
newPorts := make(map[string]string)
|
||||||
keys := make([]string, len(is.Attributes))
|
keys := make([]string, len(is.Attributes))
|
||||||
for k, _ := range is.Attributes {
|
for k := range is.Attributes {
|
||||||
keys[idx] = k
|
keys[idx] = k
|
||||||
idx++
|
idx++
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestAccComputeFirewall_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists(
|
testAccCheckComputeFirewallExists(
|
||||||
|
@ -34,7 +34,7 @@ func TestAccComputeFirewall_basic(t *testing.T) {
|
||||||
testAccCheckComputeFirewallApiVersion(&firewall),
|
testAccCheckComputeFirewallApiVersion(&firewall),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -55,7 +55,7 @@ func TestAccComputeFirewall_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists(
|
testAccCheckComputeFirewallExists(
|
||||||
|
@ -68,7 +68,7 @@ func TestAccComputeFirewall_update(t *testing.T) {
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_update(networkName, firewallName),
|
Config: testAccComputeFirewall_update(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists(
|
testAccCheckComputeFirewallExists(
|
||||||
|
@ -83,7 +83,7 @@ func TestAccComputeFirewall_update(t *testing.T) {
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists(
|
testAccCheckComputeFirewallExists(
|
||||||
|
@ -142,7 +142,7 @@ func TestAccComputeFirewall_noSource(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_noSource(networkName, firewallName),
|
Config: testAccComputeFirewall_noSource(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists(
|
testAccCheckComputeFirewallExists(
|
||||||
|
@ -150,7 +150,7 @@ func TestAccComputeFirewall_noSource(t *testing.T) {
|
||||||
testAccCheckComputeFirewallApiVersion(&firewall),
|
testAccCheckComputeFirewallApiVersion(&firewall),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -171,7 +171,7 @@ func TestAccComputeFirewall_denied(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_denied(networkName, firewallName),
|
Config: testAccComputeFirewall_denied(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists("google_compute_firewall.foobar", &firewall),
|
testAccCheckComputeFirewallExists("google_compute_firewall.foobar", &firewall),
|
||||||
|
@ -179,7 +179,7 @@ func TestAccComputeFirewall_denied(t *testing.T) {
|
||||||
testAccCheckComputeFirewallApiVersion(&firewall),
|
testAccCheckComputeFirewallApiVersion(&firewall),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -200,7 +200,7 @@ func TestAccComputeFirewall_egress(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_egress(networkName, firewallName),
|
Config: testAccComputeFirewall_egress(networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists("google_compute_firewall.foobar", &firewall),
|
testAccCheckComputeFirewallExists("google_compute_firewall.foobar", &firewall),
|
||||||
|
@ -208,7 +208,7 @@ func TestAccComputeFirewall_egress(t *testing.T) {
|
||||||
testAccCheckComputeFirewallApiVersion(&firewall),
|
testAccCheckComputeFirewallApiVersion(&firewall),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -235,7 +235,7 @@ func TestAccComputeFirewall_serviceAccounts(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_serviceAccounts(sourceSa, targetSa, networkName, firewallName),
|
Config: testAccComputeFirewall_serviceAccounts(sourceSa, targetSa, networkName, firewallName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeFirewallExists("google_compute_firewall.foobar", &firewall),
|
testAccCheckComputeFirewallExists("google_compute_firewall.foobar", &firewall),
|
||||||
|
@ -243,7 +243,7 @@ func TestAccComputeFirewall_serviceAccounts(t *testing.T) {
|
||||||
testAccCheckComputeFirewallApiVersion(&firewall),
|
testAccCheckComputeFirewallApiVersion(&firewall),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -263,18 +263,18 @@ func TestAccComputeFirewall_disabled(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
CheckDestroy: testAccCheckComputeFirewallDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_disabled(networkName, firewallName),
|
Config: testAccComputeFirewall_disabled(networkName, firewallName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
Config: testAccComputeFirewall_basic(networkName, firewallName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_firewall.foobar",
|
ResourceName: "google_compute_firewall.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -19,18 +19,18 @@ func TestAccComputeForwardingRule_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeForwardingRule_basic(poolName, ruleName),
|
Config: testAccComputeForwardingRule_basic(poolName, ruleName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar",
|
ResourceName: "google_compute_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeForwardingRule_update(poolName, ruleName),
|
Config: testAccComputeForwardingRule_update(poolName, ruleName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar",
|
ResourceName: "google_compute_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -50,10 +50,10 @@ func TestAccComputeForwardingRule_singlePort(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeForwardingRule_singlePort(poolName, ruleName),
|
Config: testAccComputeForwardingRule_singlePort(poolName, ruleName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar",
|
ResourceName: "google_compute_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -74,10 +74,10 @@ func TestAccComputeForwardingRule_ip(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeForwardingRule_ip(addrName, poolName, ruleName),
|
Config: testAccComputeForwardingRule_ip(addrName, poolName, ruleName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar",
|
ResourceName: "google_compute_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -100,15 +100,15 @@ func TestAccComputeForwardingRule_internalLoadBalancing(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeForwardingRule_internalLoadBalancing(serviceName, checkName, networkName, ruleName1, ruleName2),
|
Config: testAccComputeForwardingRule_internalLoadBalancing(serviceName, checkName, networkName, ruleName1, ruleName2),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar",
|
ResourceName: "google_compute_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar2",
|
ResourceName: "google_compute_forwarding_rule.foobar2",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -128,11 +128,11 @@ func TestAccComputeForwardingRule_networkTier(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeForwardingRule_networkTier(poolName, ruleName),
|
Config: testAccComputeForwardingRule_networkTier(poolName, ruleName),
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_forwarding_rule.foobar",
|
ResourceName: "google_compute_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -21,7 +21,7 @@ func TestAccComputeGlobalAddress_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeGlobalAddressDestroy,
|
CheckDestroy: testAccCheckComputeGlobalAddressDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeGlobalAddress_basic(),
|
Config: testAccComputeGlobalAddress_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeGlobalAddressExists(
|
testAccCheckComputeGlobalAddressExists(
|
||||||
|
@ -31,7 +31,7 @@ func TestAccComputeGlobalAddress_basic(t *testing.T) {
|
||||||
testAccCheckComputeGlobalAddressIpVersion("google_compute_global_address.foobar", ""),
|
testAccCheckComputeGlobalAddressIpVersion("google_compute_global_address.foobar", ""),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_global_address.foobar",
|
ResourceName: "google_compute_global_address.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -50,7 +50,7 @@ func TestAccComputeGlobalAddress_ipv6(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeGlobalAddressDestroy,
|
CheckDestroy: testAccCheckComputeGlobalAddressDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeGlobalAddress_ipv6(),
|
Config: testAccComputeGlobalAddress_ipv6(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeGlobalAddressExists(
|
testAccCheckComputeGlobalAddressExists(
|
||||||
|
@ -58,7 +58,7 @@ func TestAccComputeGlobalAddress_ipv6(t *testing.T) {
|
||||||
testAccCheckComputeGlobalAddressIpVersion("google_compute_global_address.foobar", "IPV6"),
|
testAccCheckComputeGlobalAddressIpVersion("google_compute_global_address.foobar", "IPV6"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_global_address.foobar",
|
ResourceName: "google_compute_global_address.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -23,39 +23,39 @@ func resourceComputeGlobalForwardingRule() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"target": &schema.Schema{
|
"target": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_address": &schema.Schema{
|
"ip_address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_protocol": &schema.Schema{
|
"ip_protocol": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"labels": &schema.Schema{
|
"labels": {
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -63,41 +63,41 @@ func resourceComputeGlobalForwardingRule() *schema.Resource {
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
},
|
},
|
||||||
|
|
||||||
"label_fingerprint": &schema.Schema{
|
"label_fingerprint": {
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"port_range": &schema.Schema{
|
"port_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
DiffSuppressFunc: portRangeDiffSuppress,
|
DiffSuppressFunc: portRangeDiffSuppress,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_version": &schema.Schema{
|
"ip_version": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"IPV4", "IPV6"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"IPV4", "IPV6"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Removed: "Please remove this attribute (it was never used)",
|
Removed: "Please remove this attribute (it was never used)",
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestAccComputeGlobalForwardingRule_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeGlobalForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeGlobalForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeGlobalForwardingRule_basic1(fr, proxy1, proxy2, backend, hc, urlmap),
|
Config: testAccComputeGlobalForwardingRule_basic1(fr, proxy1, proxy2, backend, hc, urlmap),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeGlobalForwardingRuleExists(
|
testAccCheckComputeGlobalForwardingRuleExists(
|
||||||
|
@ -36,7 +36,7 @@ func TestAccComputeGlobalForwardingRule_basic(t *testing.T) {
|
||||||
testAccCheckComputeBetaGlobalForwardingRuleIpVersion("google_compute_global_forwarding_rule.foobar", ""),
|
testAccCheckComputeBetaGlobalForwardingRuleIpVersion("google_compute_global_forwarding_rule.foobar", ""),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_global_forwarding_rule.foobar",
|
ResourceName: "google_compute_global_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -60,7 +60,7 @@ func TestAccComputeGlobalForwardingRule_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeGlobalForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeGlobalForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeGlobalForwardingRule_basic1(fr, proxy1, proxy2, backend, hc, urlmap),
|
Config: testAccComputeGlobalForwardingRule_basic1(fr, proxy1, proxy2, backend, hc, urlmap),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeGlobalForwardingRuleExists(
|
testAccCheckComputeGlobalForwardingRuleExists(
|
||||||
|
@ -68,7 +68,7 @@ func TestAccComputeGlobalForwardingRule_update(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeGlobalForwardingRule_basic2(fr, proxy1, proxy2, backend, hc, urlmap),
|
Config: testAccComputeGlobalForwardingRule_basic2(fr, proxy1, proxy2, backend, hc, urlmap),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeGlobalForwardingRuleExists(
|
testAccCheckComputeGlobalForwardingRuleExists(
|
||||||
|
@ -96,7 +96,7 @@ func TestAccComputeGlobalForwardingRule_ipv6(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeGlobalForwardingRuleDestroy,
|
CheckDestroy: testAccCheckComputeGlobalForwardingRuleDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeGlobalForwardingRule_ipv6(fr, proxy1, proxy2, backend, hc, urlmap),
|
Config: testAccComputeGlobalForwardingRule_ipv6(fr, proxy1, proxy2, backend, hc, urlmap),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeBetaGlobalForwardingRuleExists(
|
testAccCheckComputeBetaGlobalForwardingRuleExists(
|
||||||
|
@ -104,7 +104,7 @@ func TestAccComputeGlobalForwardingRule_ipv6(t *testing.T) {
|
||||||
testAccCheckComputeBetaGlobalForwardingRuleIpVersion("google_compute_global_forwarding_rule.foobar", "IPV6"),
|
testAccCheckComputeBetaGlobalForwardingRuleIpVersion("google_compute_global_forwarding_rule.foobar", "IPV6"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_global_forwarding_rule.foobar",
|
ResourceName: "google_compute_global_forwarding_rule.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -23,7 +23,7 @@ func TestAccComputeHealthCheck_tcp(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_tcp(hckName),
|
Config: testAccComputeHealthCheck_tcp(hckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHealthCheckExists(
|
testAccCheckComputeHealthCheckExists(
|
||||||
|
@ -33,7 +33,7 @@ func TestAccComputeHealthCheck_tcp(t *testing.T) {
|
||||||
testAccCheckComputeHealthCheckTcpPort(80, &healthCheck),
|
testAccCheckComputeHealthCheckTcpPort(80, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_health_check.foobar",
|
ResourceName: "google_compute_health_check.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -54,7 +54,7 @@ func TestAccComputeHealthCheck_tcp_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_tcp(hckName),
|
Config: testAccComputeHealthCheck_tcp(hckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHealthCheckExists(
|
testAccCheckComputeHealthCheckExists(
|
||||||
|
@ -64,7 +64,7 @@ func TestAccComputeHealthCheck_tcp_update(t *testing.T) {
|
||||||
testAccCheckComputeHealthCheckTcpPort(80, &healthCheck),
|
testAccCheckComputeHealthCheckTcpPort(80, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_tcp_update(hckName),
|
Config: testAccComputeHealthCheck_tcp_update(hckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHealthCheckExists(
|
testAccCheckComputeHealthCheckExists(
|
||||||
|
@ -90,7 +90,7 @@ func TestAccComputeHealthCheck_ssl(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_ssl(hckName),
|
Config: testAccComputeHealthCheck_ssl(hckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHealthCheckExists(
|
testAccCheckComputeHealthCheckExists(
|
||||||
|
@ -99,7 +99,7 @@ func TestAccComputeHealthCheck_ssl(t *testing.T) {
|
||||||
3, 3, &healthCheck),
|
3, 3, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_health_check.foobar",
|
ResourceName: "google_compute_health_check.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -120,7 +120,7 @@ func TestAccComputeHealthCheck_http(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_http(hckName),
|
Config: testAccComputeHealthCheck_http(hckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHealthCheckExists(
|
testAccCheckComputeHealthCheckExists(
|
||||||
|
@ -129,7 +129,7 @@ func TestAccComputeHealthCheck_http(t *testing.T) {
|
||||||
3, 3, &healthCheck),
|
3, 3, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_health_check.foobar",
|
ResourceName: "google_compute_health_check.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -150,7 +150,7 @@ func TestAccComputeHealthCheck_https(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_https(hckName),
|
Config: testAccComputeHealthCheck_https(hckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHealthCheckExists(
|
testAccCheckComputeHealthCheckExists(
|
||||||
|
@ -159,7 +159,7 @@ func TestAccComputeHealthCheck_https(t *testing.T) {
|
||||||
3, 3, &healthCheck),
|
3, 3, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_health_check.foobar",
|
ResourceName: "google_compute_health_check.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -178,19 +178,19 @@ func TestAccComputeHealthCheck_typeTransition(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_https(hckName),
|
Config: testAccComputeHealthCheck_https(hckName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_http(hckName),
|
Config: testAccComputeHealthCheck_http(hckName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_ssl(hckName),
|
Config: testAccComputeHealthCheck_ssl(hckName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_tcp(hckName),
|
Config: testAccComputeHealthCheck_tcp(hckName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_https(hckName),
|
Config: testAccComputeHealthCheck_https(hckName),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -207,7 +207,7 @@ func TestAccComputeHealthCheck_tcpAndSsl_shouldFail(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHealthCheck_tcpAndSsl_shouldFail(hckName),
|
Config: testAccComputeHealthCheck_tcpAndSsl_shouldFail(hckName),
|
||||||
ExpectError: regexp.MustCompile("conflicts with tcp_health_check"),
|
ExpectError: regexp.MustCompile("conflicts with tcp_health_check"),
|
||||||
},
|
},
|
||||||
|
|
|
@ -22,7 +22,7 @@ func TestAccComputeHttpHealthCheck_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHttpHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHttpHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHttpHealthCheck_basic(hhckName),
|
Config: testAccComputeHttpHealthCheck_basic(hhckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHttpHealthCheckExists(
|
testAccCheckComputeHttpHealthCheckExists(
|
||||||
|
@ -33,7 +33,7 @@ func TestAccComputeHttpHealthCheck_basic(t *testing.T) {
|
||||||
3, 3, &healthCheck),
|
3, 3, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_http_health_check.foobar",
|
ResourceName: "google_compute_http_health_check.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -54,7 +54,7 @@ func TestAccComputeHttpHealthCheck_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHttpHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHttpHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHttpHealthCheck_update1(hhckName),
|
Config: testAccComputeHttpHealthCheck_update1(hhckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHttpHealthCheckExists(
|
testAccCheckComputeHttpHealthCheckExists(
|
||||||
|
@ -65,7 +65,7 @@ func TestAccComputeHttpHealthCheck_update(t *testing.T) {
|
||||||
2, 2, &healthCheck),
|
2, 2, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHttpHealthCheck_update2(hhckName),
|
Config: testAccComputeHttpHealthCheck_update2(hhckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHttpHealthCheckExists(
|
testAccCheckComputeHttpHealthCheckExists(
|
||||||
|
|
|
@ -22,7 +22,7 @@ func TestAccComputeHttpsHealthCheck_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHttpsHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHttpsHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHttpsHealthCheck_basic(hhckName),
|
Config: testAccComputeHttpsHealthCheck_basic(hhckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHttpsHealthCheckExists(
|
testAccCheckComputeHttpsHealthCheckExists(
|
||||||
|
@ -33,7 +33,7 @@ func TestAccComputeHttpsHealthCheck_basic(t *testing.T) {
|
||||||
3, 3, &healthCheck),
|
3, 3, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_https_health_check.foobar",
|
ResourceName: "google_compute_https_health_check.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -54,7 +54,7 @@ func TestAccComputeHttpsHealthCheck_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeHttpsHealthCheckDestroy,
|
CheckDestroy: testAccCheckComputeHttpsHealthCheckDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHttpsHealthCheck_update1(hhckName),
|
Config: testAccComputeHttpsHealthCheck_update1(hhckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHttpsHealthCheckExists(
|
testAccCheckComputeHttpsHealthCheckExists(
|
||||||
|
@ -65,7 +65,7 @@ func TestAccComputeHttpsHealthCheck_update(t *testing.T) {
|
||||||
2, 2, &healthCheck),
|
2, 2, &healthCheck),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeHttpsHealthCheck_update2(hhckName),
|
Config: testAccComputeHttpsHealthCheck_update2(hhckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeHttpsHealthCheckExists(
|
testAccCheckComputeHttpsHealthCheckExists(
|
||||||
|
|
|
@ -30,55 +30,55 @@ func resourceComputeImage() *schema.Resource {
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
// TODO(cblecker): one of source_disk or raw_disk is required
|
// TODO(cblecker): one of source_disk or raw_disk is required
|
||||||
|
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"family": &schema.Schema{
|
"family": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"source_disk": &schema.Schema{
|
"source_disk": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"raw_disk": &schema.Schema{
|
"raw_disk": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"source": &schema.Schema{
|
"source": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"sha1": &schema.Schema{
|
"sha1": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"container_type": &schema.Schema{
|
"container_type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "TAR",
|
Default: "TAR",
|
||||||
|
@ -88,25 +88,25 @@ func resourceComputeImage() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"create_timeout": &schema.Schema{
|
"create_timeout": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "Use timeouts block instead. See https://www.terraform.io/docs/configuration/resources.html#timeouts.",
|
Removed: "Use timeouts block instead. See https://www.terraform.io/docs/configuration/resources.html#timeouts.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"labels": &schema.Schema{
|
"labels": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
},
|
},
|
||||||
|
|
||||||
"licenses": &schema.Schema{
|
"licenses": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -114,7 +114,7 @@ func resourceComputeImage() *schema.Resource {
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"label_fingerprint": &schema.Schema{
|
"label_fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestAccComputeImage_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeImageDestroy,
|
CheckDestroy: testAccCheckComputeImageDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeImage_basic("image-test-" + acctest.RandString(10)),
|
Config: testAccComputeImage_basic("image-test-" + acctest.RandString(10)),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeImageExists(
|
testAccCheckComputeImageExists(
|
||||||
|
@ -46,7 +46,7 @@ func TestAccComputeImage_withLicense(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeImageDestroy,
|
CheckDestroy: testAccCheckComputeImageDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeImage_license("image-test-" + acctest.RandString(10)),
|
Config: testAccComputeImage_license("image-test-" + acctest.RandString(10)),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeImageExists(
|
testAccCheckComputeImageExists(
|
||||||
|
@ -75,7 +75,7 @@ func TestAccComputeImage_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeImageDestroy,
|
CheckDestroy: testAccCheckComputeImageDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeImage_basic(name),
|
Config: testAccComputeImage_basic(name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeImageExists(
|
testAccCheckComputeImageExists(
|
||||||
|
@ -85,7 +85,7 @@ func TestAccComputeImage_update(t *testing.T) {
|
||||||
testAccCheckComputeImageHasComputedFingerprint(&image, "google_compute_image.foobar"),
|
testAccCheckComputeImageHasComputedFingerprint(&image, "google_compute_image.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeImage_update(name),
|
Config: testAccComputeImage_update(name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeImageExists(
|
testAccCheckComputeImageExists(
|
||||||
|
@ -96,7 +96,7 @@ func TestAccComputeImage_update(t *testing.T) {
|
||||||
testAccCheckComputeImageHasComputedFingerprint(&image, "google_compute_image.foobar"),
|
testAccCheckComputeImageHasComputedFingerprint(&image, "google_compute_image.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_image.foobar",
|
ResourceName: "google_compute_image.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -116,7 +116,7 @@ func TestAccComputeImage_basedondisk(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeImageDestroy,
|
CheckDestroy: testAccCheckComputeImageDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeImage_basedondisk(),
|
Config: testAccComputeImage_basedondisk(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeImageExists(
|
testAccCheckComputeImageExists(
|
||||||
|
@ -124,7 +124,7 @@ func TestAccComputeImage_basedondisk(t *testing.T) {
|
||||||
testAccCheckComputeImageHasSourceDisk(&image),
|
testAccCheckComputeImageHasSourceDisk(&image),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_image.foobar",
|
ResourceName: "google_compute_image.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -42,40 +42,40 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
// template. Please attempt to maintain consistency with the
|
// template. Please attempt to maintain consistency with the
|
||||||
// resource_compute_instance_template schema when updating this one.
|
// resource_compute_instance_template schema when updating this one.
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"boot_disk": &schema.Schema{
|
"boot_disk": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"auto_delete": &schema.Schema{
|
"auto_delete": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"device_name": &schema.Schema{
|
"device_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_raw": &schema.Schema{
|
"disk_encryption_key_raw": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_sha256": &schema.Schema{
|
"disk_encryption_key_sha256": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"initialize_params": &schema.Schema{
|
"initialize_params": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -83,7 +83,7 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"size": &schema.Schema{
|
"size": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -91,7 +91,7 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
ValidateFunc: validation.IntAtLeast(1),
|
ValidateFunc: validation.IntAtLeast(1),
|
||||||
},
|
},
|
||||||
|
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -99,7 +99,7 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"pd-standard", "pd-ssd"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"image": &schema.Schema{
|
"image": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -110,7 +110,7 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"source": &schema.Schema{
|
"source": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -122,24 +122,24 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"machine_type": &schema.Schema{
|
"machine_type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network_interface": &schema.Schema{
|
"network_interface": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"network": &schema.Schema{
|
"network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -147,7 +147,7 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"subnetwork": &schema.Schema{
|
"subnetwork": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -155,50 +155,50 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"subnetwork_project": &schema.Schema{
|
"subnetwork_project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network_ip": &schema.Schema{
|
"network_ip": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"access_config": &schema.Schema{
|
"access_config": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"nat_ip": &schema.Schema{
|
"nat_ip": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network_tier": &schema.Schema{
|
"network_tier": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"assigned_nat_ip": &schema.Schema{
|
"assigned_nat_ip": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "Use network_interface.access_config.nat_ip instead.",
|
Removed: "Use network_interface.access_config.nat_ip instead.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"public_ptr_domain_name": &schema.Schema{
|
"public_ptr_domain_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
@ -206,17 +206,17 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"alias_ip_range": &schema.Schema{
|
"alias_ip_range": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"ip_cidr_range": &schema.Schema{
|
"ip_cidr_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
DiffSuppressFunc: ipCidrRangeDiffSuppress,
|
DiffSuppressFunc: ipCidrRangeDiffSuppress,
|
||||||
},
|
},
|
||||||
"subnetwork_range_name": &schema.Schema{
|
"subnetwork_range_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
@ -224,7 +224,7 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"address": &schema.Schema{
|
"address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -235,42 +235,42 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"allow_stopping_for_update": &schema.Schema{
|
"allow_stopping_for_update": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"attached_disk": &schema.Schema{
|
"attached_disk": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"source": &schema.Schema{
|
"source": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"device_name": &schema.Schema{
|
"device_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"mode": &schema.Schema{
|
"mode": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "READ_WRITE",
|
Default: "READ_WRITE",
|
||||||
ValidateFunc: validation.StringInSlice([]string{"READ_WRITE", "READ_ONLY"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"READ_WRITE", "READ_ONLY"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_raw": &schema.Schema{
|
"disk_encryption_key_raw": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_sha256": &schema.Schema{
|
"disk_encryption_key_sha256": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
@ -278,32 +278,32 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"can_ip_forward": &schema.Schema{
|
"can_ip_forward": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"create_timeout": &schema.Schema{
|
"create_timeout": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "Use timeouts block instead.",
|
Removed: "Use timeouts block instead.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"deletion_protection": &schema.Schema{
|
"deletion_protection": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk": &schema.Schema{
|
"disk": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -312,56 +312,56 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
// TODO(mitchellh): one of image or disk is required
|
// TODO(mitchellh): one of image or disk is required
|
||||||
|
|
||||||
"disk": &schema.Schema{
|
"disk": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"image": &schema.Schema{
|
"image": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"scratch": &schema.Schema{
|
"scratch": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"auto_delete": &schema.Schema{
|
"auto_delete": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"size": &schema.Schema{
|
"size": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"device_name": &schema.Schema{
|
"device_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_raw": &schema.Schema{
|
"disk_encryption_key_raw": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_encryption_key_sha256": &schema.Schema{
|
"disk_encryption_key_sha256": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
@ -369,19 +369,19 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"guest_accelerator": &schema.Schema{
|
"guest_accelerator": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"count": &schema.Schema{
|
"count": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -391,57 +391,57 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"labels": &schema.Schema{
|
"labels": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
},
|
},
|
||||||
|
|
||||||
"metadata": &schema.Schema{
|
"metadata": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
|
|
||||||
"metadata_startup_script": &schema.Schema{
|
"metadata_startup_script": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"min_cpu_platform": &schema.Schema{
|
"min_cpu_platform": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"scheduling": &schema.Schema{
|
"scheduling": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"on_host_maintenance": &schema.Schema{
|
"on_host_maintenance": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"automatic_restart": &schema.Schema{
|
"automatic_restart": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"preemptible": &schema.Schema{
|
"preemptible": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
|
@ -451,13 +451,13 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"scratch_disk": &schema.Schema{
|
"scratch_disk": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"interface": &schema.Schema{
|
"interface": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "SCSI",
|
Default: "SCSI",
|
||||||
|
@ -467,19 +467,19 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"service_account": &schema.Schema{
|
"service_account": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"email": &schema.Schema{
|
"email": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"scopes": &schema.Schema{
|
"scopes": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Required: true,
|
Required: true,
|
||||||
Elem: &schema.Schema{
|
Elem: &schema.Schema{
|
||||||
|
@ -494,46 +494,46 @@ func resourceComputeInstance() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"tags": &schema.Schema{
|
"tags": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
},
|
},
|
||||||
|
|
||||||
"zone": &schema.Schema{
|
"zone": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"cpu_platform": &schema.Schema{
|
"cpu_platform": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_id": &schema.Schema{
|
"instance_id": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"label_fingerprint": &schema.Schema{
|
"label_fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"metadata_fingerprint": &schema.Schema{
|
"metadata_fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"tags_fingerprint": &schema.Schema{
|
"tags_fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,7 +23,7 @@ func TestAccComputeInstanceFromTemplate_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceFromTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceFromTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceFromTemplate_basic(instanceName, templateName),
|
Config: testAccComputeInstanceFromTemplate_basic(instanceName, templateName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(resourceName, &instance),
|
testAccCheckComputeInstanceExists(resourceName, &instance),
|
||||||
|
|
|
@ -31,52 +31,52 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"base_instance_name": &schema.Schema{
|
"base_instance_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_template": &schema.Schema{
|
"instance_template": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"version": &schema.Schema{
|
"version": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_template": &schema.Schema{
|
"instance_template": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"target_size": &schema.Schema{
|
"target_size": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"fixed": &schema.Schema{
|
"fixed": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"percent": &schema.Schema{
|
"percent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
|
@ -89,46 +89,46 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"zone": &schema.Schema{
|
"zone": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"fingerprint": &schema.Schema{
|
"fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_group": &schema.Schema{
|
"instance_group": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"named_port": &schema.Schema{
|
"named_port": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"port": &schema.Schema{
|
"port": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
@ -136,19 +136,19 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"update_strategy": &schema.Schema{
|
"update_strategy": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "REPLACE",
|
Default: "REPLACE",
|
||||||
|
@ -164,7 +164,7 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"target_pools": &schema.Schema{
|
"target_pools": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{
|
Elem: &schema.Schema{
|
||||||
|
@ -173,27 +173,27 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
Set: selfLinkRelativePathHash,
|
Set: selfLinkRelativePathHash,
|
||||||
},
|
},
|
||||||
|
|
||||||
"target_size": &schema.Schema{
|
"target_size": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"auto_healing_policies": &schema.Schema{
|
"auto_healing_policies": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"health_check": &schema.Schema{
|
"health_check": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"initial_delay_sec": &schema.Schema{
|
"initial_delay_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
|
@ -203,7 +203,7 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"rolling_update_policy": &schema.Schema{
|
"rolling_update_policy": {
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
|
@ -211,48 +211,48 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"minimal_action": &schema.Schema{
|
"minimal_action": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.StringInSlice([]string{"RESTART", "REPLACE"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"RESTART", "REPLACE"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.StringInSlice([]string{"OPPORTUNISTIC", "PROACTIVE"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"OPPORTUNISTIC", "PROACTIVE"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_surge_fixed": &schema.Schema{
|
"max_surge_fixed": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_surge_percent": &schema.Schema{
|
"max_surge_percent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.IntBetween(0, 100),
|
ValidateFunc: validation.IntBetween(0, 100),
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_unavailable_fixed": &schema.Schema{
|
"max_unavailable_fixed": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_unavailable_percent": &schema.Schema{
|
"max_unavailable_percent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.IntBetween(0, 100),
|
ValidateFunc: validation.IntBetween(0, 100),
|
||||||
},
|
},
|
||||||
|
|
||||||
"min_ready_sec": &schema.Schema{
|
"min_ready_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -262,7 +262,7 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"wait_for_instances": &schema.Schema{
|
"wait_for_instances": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
|
|
|
@ -176,7 +176,7 @@ func TestAccComputeInstanceGroup_network(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccComputeInstanceGroup_destroy,
|
CheckDestroy: testAccComputeInstanceGroup_destroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceGroup_network(instanceName),
|
Config: testAccComputeInstanceGroup_network(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccComputeInstanceGroup_exists(
|
testAccComputeInstanceGroup_exists(
|
||||||
|
|
|
@ -283,7 +283,7 @@ func migrateStateV3toV4(is *terraform.InstanceState, meta interface{}) (*terrafo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, _ := range is.Attributes {
|
for k := range is.Attributes {
|
||||||
if !strings.HasPrefix(k, "disk.") {
|
if !strings.HasPrefix(k, "disk.") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
// instance. Please attempt to maintain consistency with the
|
// instance. Please attempt to maintain consistency with the
|
||||||
// resource_compute_instance schema when updating this one.
|
// resource_compute_instance schema when updating this one.
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -36,7 +36,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
ValidateFunc: validateGCPName,
|
ValidateFunc: validateGCPName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"name_prefix": &schema.Schema{
|
"name_prefix": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -53,79 +53,79 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk": &schema.Schema{
|
"disk": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"auto_delete": &schema.Schema{
|
"auto_delete": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"boot": &schema.Schema{
|
"boot": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"device_name": &schema.Schema{
|
"device_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_name": &schema.Schema{
|
"disk_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_size_gb": &schema.Schema{
|
"disk_size_gb": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"disk_type": &schema.Schema{
|
"disk_type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"source_image": &schema.Schema{
|
"source_image": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"interface": &schema.Schema{
|
"interface": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"mode": &schema.Schema{
|
"mode": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"source": &schema.Schema{
|
"source": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -152,62 +152,62 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"machine_type": &schema.Schema{
|
"machine_type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"automatic_restart": &schema.Schema{
|
"automatic_restart": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Removed: "Use 'scheduling.automatic_restart' instead.",
|
Removed: "Use 'scheduling.automatic_restart' instead.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"can_ip_forward": &schema.Schema{
|
"can_ip_forward": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_description": &schema.Schema{
|
"instance_description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"metadata": &schema.Schema{
|
"metadata": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"metadata_startup_script": &schema.Schema{
|
"metadata_startup_script": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"metadata_fingerprint": &schema.Schema{
|
"metadata_fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network_interface": &schema.Schema{
|
"network_interface": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"network": &schema.Schema{
|
"network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -215,13 +215,13 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"network_ip": &schema.Schema{
|
"network_ip": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"subnetwork": &schema.Schema{
|
"subnetwork": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -229,32 +229,32 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
DiffSuppressFunc: compareSelfLinkOrResourceName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"subnetwork_project": &schema.Schema{
|
"subnetwork_project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"access_config": &schema.Schema{
|
"access_config": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"nat_ip": &schema.Schema{
|
"nat_ip": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"network_tier": &schema.Schema{
|
"network_tier": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false),
|
||||||
},
|
},
|
||||||
"assigned_nat_ip": &schema.Schema{
|
"assigned_nat_ip": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "Use network_interface.access_config.nat_ip instead.",
|
Removed: "Use network_interface.access_config.nat_ip instead.",
|
||||||
|
@ -263,19 +263,19 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"alias_ip_range": &schema.Schema{
|
"alias_ip_range": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"ip_cidr_range": &schema.Schema{
|
"ip_cidr_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
DiffSuppressFunc: ipCidrRangeDiffSuppress,
|
DiffSuppressFunc: ipCidrRangeDiffSuppress,
|
||||||
},
|
},
|
||||||
"subnetwork_range_name": &schema.Schema{
|
"subnetwork_range_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -284,7 +284,7 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"address": &schema.Schema{
|
"address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -294,49 +294,49 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"on_host_maintenance": &schema.Schema{
|
"on_host_maintenance": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Removed: "Use 'scheduling.on_host_maintenance' instead.",
|
Removed: "Use 'scheduling.on_host_maintenance' instead.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"scheduling": &schema.Schema{
|
"scheduling": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"preemptible": &schema.Schema{
|
"preemptible": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"automatic_restart": &schema.Schema{
|
"automatic_restart": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"on_host_maintenance": &schema.Schema{
|
"on_host_maintenance": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
@ -346,26 +346,26 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"service_account": &schema.Schema{
|
"service_account": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"email": &schema.Schema{
|
"email": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"scopes": &schema.Schema{
|
"scopes": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -381,18 +381,18 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"guest_accelerator": &schema.Schema{
|
"guest_accelerator": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"count": &schema.Schema{
|
"count": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -402,13 +402,13 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"min_cpu_platform": &schema.Schema{
|
"min_cpu_platform": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"tags": &schema.Schema{
|
"tags": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -416,12 +416,12 @@ func resourceComputeInstanceTemplate() *schema.Resource {
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
},
|
},
|
||||||
|
|
||||||
"tags_fingerprint": &schema.Schema{
|
"tags_fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"labels": &schema.Schema{
|
"labels": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -24,7 +24,7 @@ func TestAccComputeInstanceTemplate_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_basic(),
|
Config: testAccComputeInstanceTemplate_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -34,7 +34,7 @@ func TestAccComputeInstanceTemplate_basic(t *testing.T) {
|
||||||
testAccCheckComputeInstanceTemplateContainsLabel(&instanceTemplate, "my_label", "foobar"),
|
testAccCheckComputeInstanceTemplateContainsLabel(&instanceTemplate, "my_label", "foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -53,14 +53,14 @@ func TestAccComputeInstanceTemplate_imageShorthand(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_imageShorthand(),
|
Config: testAccComputeInstanceTemplate_imageShorthand(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
"google_compute_instance_template.foobar", &instanceTemplate),
|
"google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -79,7 +79,7 @@ func TestAccComputeInstanceTemplate_preemptible(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_preemptible(),
|
Config: testAccComputeInstanceTemplate_preemptible(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -88,7 +88,7 @@ func TestAccComputeInstanceTemplate_preemptible(t *testing.T) {
|
||||||
testAccCheckComputeInstanceTemplatePreemptible(&instanceTemplate, true),
|
testAccCheckComputeInstanceTemplatePreemptible(&instanceTemplate, true),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -107,7 +107,7 @@ func TestAccComputeInstanceTemplate_IP(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_ip(),
|
Config: testAccComputeInstanceTemplate_ip(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -115,7 +115,7 @@ func TestAccComputeInstanceTemplate_IP(t *testing.T) {
|
||||||
testAccCheckComputeInstanceTemplateNetwork(&instanceTemplate),
|
testAccCheckComputeInstanceTemplateNetwork(&instanceTemplate),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -132,10 +132,10 @@ func TestAccComputeInstanceTemplate_networkTier(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_networkTier(),
|
Config: testAccComputeInstanceTemplate_networkTier(),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -155,7 +155,7 @@ func TestAccComputeInstanceTemplate_networkIP(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_networkIP(networkIP),
|
Config: testAccComputeInstanceTemplate_networkIP(networkIP),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -165,7 +165,7 @@ func TestAccComputeInstanceTemplate_networkIP(t *testing.T) {
|
||||||
"google_compute_instance_template.foobar", networkIP, &instanceTemplate),
|
"google_compute_instance_template.foobar", networkIP, &instanceTemplate),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -184,7 +184,7 @@ func TestAccComputeInstanceTemplate_networkIPAddress(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_networkIPAddress(ipAddress),
|
Config: testAccComputeInstanceTemplate_networkIPAddress(ipAddress),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -194,7 +194,7 @@ func TestAccComputeInstanceTemplate_networkIPAddress(t *testing.T) {
|
||||||
"google_compute_instance_template.foobar", ipAddress, &instanceTemplate),
|
"google_compute_instance_template.foobar", ipAddress, &instanceTemplate),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -211,10 +211,10 @@ func TestAccComputeInstanceTemplate_disks(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_disks(),
|
Config: testAccComputeInstanceTemplate_disks(),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -231,10 +231,10 @@ func TestAccComputeInstanceTemplate_regionDisks(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_regionDisks(),
|
Config: testAccComputeInstanceTemplate_regionDisks(),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -254,7 +254,7 @@ func TestAccComputeInstanceTemplate_subnet_auto(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_subnet_auto(network),
|
Config: testAccComputeInstanceTemplate_subnet_auto(network),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -262,7 +262,7 @@ func TestAccComputeInstanceTemplate_subnet_auto(t *testing.T) {
|
||||||
testAccCheckComputeInstanceTemplateNetworkName(&instanceTemplate, network),
|
testAccCheckComputeInstanceTemplateNetworkName(&instanceTemplate, network),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -281,7 +281,7 @@ func TestAccComputeInstanceTemplate_subnet_custom(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_subnet_custom(),
|
Config: testAccComputeInstanceTemplate_subnet_custom(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -289,7 +289,7 @@ func TestAccComputeInstanceTemplate_subnet_custom(t *testing.T) {
|
||||||
testAccCheckComputeInstanceTemplateSubnetwork(&instanceTemplate),
|
testAccCheckComputeInstanceTemplateSubnetwork(&instanceTemplate),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -311,7 +311,7 @@ func TestAccComputeInstanceTemplate_subnet_xpn(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_subnet_xpn(org, billingId, projectName),
|
Config: testAccComputeInstanceTemplate_subnet_xpn(org, billingId, projectName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExistsInProject(
|
testAccCheckComputeInstanceTemplateExistsInProject(
|
||||||
|
@ -334,7 +334,7 @@ func TestAccComputeInstanceTemplate_metadata_startup_script(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_startup_script(),
|
Config: testAccComputeInstanceTemplate_startup_script(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists(
|
testAccCheckComputeInstanceTemplateExists(
|
||||||
|
@ -355,14 +355,14 @@ func TestAccComputeInstanceTemplate_primaryAliasIpRange(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_primaryAliasIpRange(acctest.RandString(10)),
|
Config: testAccComputeInstanceTemplate_primaryAliasIpRange(acctest.RandString(10)),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
testAccCheckComputeInstanceTemplateHasAliasIpRange(&instanceTemplate, "", "/24"),
|
testAccCheckComputeInstanceTemplateHasAliasIpRange(&instanceTemplate, "", "/24"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -381,14 +381,14 @@ func TestAccComputeInstanceTemplate_secondaryAliasIpRange(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_secondaryAliasIpRange(acctest.RandString(10)),
|
Config: testAccComputeInstanceTemplate_secondaryAliasIpRange(acctest.RandString(10)),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
testAccCheckComputeInstanceTemplateHasAliasIpRange(&instanceTemplate, "inst-test-secondary", "/24"),
|
testAccCheckComputeInstanceTemplateHasAliasIpRange(&instanceTemplate, "inst-test-secondary", "/24"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -407,14 +407,14 @@ func TestAccComputeInstanceTemplate_guestAccelerator(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_guestAccelerator(acctest.RandString(10), 1),
|
Config: testAccComputeInstanceTemplate_guestAccelerator(acctest.RandString(10), 1),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
testAccCheckComputeInstanceTemplateHasGuestAccelerator(&instanceTemplate, "nvidia-tesla-k80", 1),
|
testAccCheckComputeInstanceTemplateHasGuestAccelerator(&instanceTemplate, "nvidia-tesla-k80", 1),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -434,7 +434,7 @@ func TestAccComputeInstanceTemplate_guestAcceleratorSkip(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_guestAccelerator(acctest.RandString(10), 0),
|
Config: testAccComputeInstanceTemplate_guestAccelerator(acctest.RandString(10), 0),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
|
@ -456,14 +456,14 @@ func TestAccComputeInstanceTemplate_minCpuPlatform(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_minCpuPlatform(acctest.RandString(10)),
|
Config: testAccComputeInstanceTemplate_minCpuPlatform(acctest.RandString(10)),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
testAccCheckComputeInstanceTemplateHasMinCpuPlatform(&instanceTemplate, DEFAULT_MIN_CPU_TEST_VALUE),
|
testAccCheckComputeInstanceTemplateHasMinCpuPlatform(&instanceTemplate, DEFAULT_MIN_CPU_TEST_VALUE),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -489,13 +489,13 @@ func TestAccComputeInstanceTemplate_EncryptKMS(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
CheckDestroy: testAccCheckComputeInstanceTemplateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstanceTemplate_encryptionKMS(pid, pname, org, billingAccount, diskName, keyRingName, keyName),
|
Config: testAccComputeInstanceTemplate_encryptionKMS(pid, pname, org, billingAccount, diskName, keyRingName, keyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
testAccCheckComputeInstanceTemplateExists("google_compute_instance_template.foobar", &instanceTemplate),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_instance_template.foobar",
|
ResourceName: "google_compute_instance_template.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -39,7 +39,7 @@ func TestAccComputeInstance_basic1(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic(instanceName),
|
Config: testAccComputeInstance_basic(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -72,7 +72,7 @@ func TestAccComputeInstance_basic2(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic2(instanceName),
|
Config: testAccComputeInstance_basic2(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -97,7 +97,7 @@ func TestAccComputeInstance_basic3(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic3(instanceName),
|
Config: testAccComputeInstance_basic3(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -122,7 +122,7 @@ func TestAccComputeInstance_basic4(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic4(instanceName),
|
Config: testAccComputeInstance_basic4(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -147,7 +147,7 @@ func TestAccComputeInstance_basic5(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic5(instanceName),
|
Config: testAccComputeInstance_basic5(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -173,7 +173,7 @@ func TestAccComputeInstance_IP(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_ip(ipName, instanceName),
|
Config: testAccComputeInstance_ip(ipName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -198,7 +198,7 @@ func TestAccComputeInstance_PTRRecord(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_PTRRecord(ptrName, instanceName),
|
Config: testAccComputeInstance_PTRRecord(ptrName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -207,7 +207,7 @@ func TestAccComputeInstance_PTRRecord(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
computeInstanceImportStep("us-central1-a", instanceName, []string{"metadata.baz", "metadata.foo"}),
|
computeInstanceImportStep("us-central1-a", instanceName, []string{"metadata.baz", "metadata.foo"}),
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_ip(ipName, instanceName),
|
Config: testAccComputeInstance_ip(ipName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -229,7 +229,7 @@ func TestAccComputeInstance_networkTier(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_networkTier(instanceName),
|
Config: testAccComputeInstance_networkTier(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -270,7 +270,7 @@ func TestAccComputeInstance_diskEncryption(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_disks_encryption(bootEncryptionKey, diskNameToEncryptionKey, instanceName),
|
Config: testAccComputeInstance_disks_encryption(bootEncryptionKey, diskNameToEncryptionKey, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -294,7 +294,7 @@ func TestAccComputeInstance_attachedDisk(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_attachedDisk(diskName, instanceName),
|
Config: testAccComputeInstance_attachedDisk(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -319,7 +319,7 @@ func TestAccComputeInstance_attachedDisk_sourceUrl(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_attachedDisk_sourceUrl(diskName, instanceName),
|
Config: testAccComputeInstance_attachedDisk_sourceUrl(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -344,7 +344,7 @@ func TestAccComputeInstance_attachedDisk_modeRo(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_attachedDisk_modeRo(diskName, instanceName),
|
Config: testAccComputeInstance_attachedDisk_modeRo(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -370,7 +370,7 @@ func TestAccComputeInstance_attachedDiskUpdate(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_attachedDisk(diskName, instanceName),
|
Config: testAccComputeInstance_attachedDisk(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -379,7 +379,7 @@ func TestAccComputeInstance_attachedDiskUpdate(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// check attaching
|
// check attaching
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_addAttachedDisk(diskName, diskName2, instanceName),
|
Config: testAccComputeInstance_addAttachedDisk(diskName, diskName2, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -389,7 +389,7 @@ func TestAccComputeInstance_attachedDiskUpdate(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// check detaching
|
// check detaching
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_detachDisk(diskName, diskName2, instanceName),
|
Config: testAccComputeInstance_detachDisk(diskName, diskName2, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -398,7 +398,7 @@ func TestAccComputeInstance_attachedDiskUpdate(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// check updating
|
// check updating
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_updateAttachedDiskEncryptionKey(diskName, instanceName),
|
Config: testAccComputeInstance_updateAttachedDiskEncryptionKey(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -422,7 +422,7 @@ func TestAccComputeInstance_bootDisk_source(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_bootDisk_source(diskName, instanceName),
|
Config: testAccComputeInstance_bootDisk_source(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -447,7 +447,7 @@ func TestAccComputeInstance_bootDisk_sourceUrl(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_bootDisk_sourceUrl(diskName, instanceName),
|
Config: testAccComputeInstance_bootDisk_sourceUrl(diskName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -472,7 +472,7 @@ func TestAccComputeInstance_bootDisk_type(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_bootDisk_type(instanceName, diskType),
|
Config: testAccComputeInstance_bootDisk_type(instanceName, diskType),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -495,7 +495,7 @@ func TestAccComputeInstance_scratchDisk(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_scratchDisk(instanceName),
|
Config: testAccComputeInstance_scratchDisk(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -519,14 +519,14 @@ func TestAccComputeInstance_forceNewAndChangeMetadata(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic(instanceName),
|
Config: testAccComputeInstance_basic(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
"google_compute_instance.foobar", &instance),
|
"google_compute_instance.foobar", &instance),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_forceNewAndChangeMetadata(instanceName),
|
Config: testAccComputeInstance_forceNewAndChangeMetadata(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -550,14 +550,14 @@ func TestAccComputeInstance_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic(instanceName),
|
Config: testAccComputeInstance_basic(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
"google_compute_instance.foobar", &instance),
|
"google_compute_instance.foobar", &instance),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_update(instanceName),
|
Config: testAccComputeInstance_update(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -585,7 +585,7 @@ func TestAccComputeInstance_stopInstanceToUpdate(t *testing.T) {
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
// Set fields that require stopping the instance
|
// Set fields that require stopping the instance
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_stopInstanceToUpdate(instanceName),
|
Config: testAccComputeInstance_stopInstanceToUpdate(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -594,7 +594,7 @@ func TestAccComputeInstance_stopInstanceToUpdate(t *testing.T) {
|
||||||
},
|
},
|
||||||
computeInstanceImportStep("us-central1-a", instanceName, []string{"allow_stopping_for_update"}),
|
computeInstanceImportStep("us-central1-a", instanceName, []string{"allow_stopping_for_update"}),
|
||||||
// Check that updating them works
|
// Check that updating them works
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_stopInstanceToUpdate2(instanceName),
|
Config: testAccComputeInstance_stopInstanceToUpdate2(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -603,7 +603,7 @@ func TestAccComputeInstance_stopInstanceToUpdate(t *testing.T) {
|
||||||
},
|
},
|
||||||
computeInstanceImportStep("us-central1-a", instanceName, []string{"allow_stopping_for_update"}),
|
computeInstanceImportStep("us-central1-a", instanceName, []string{"allow_stopping_for_update"}),
|
||||||
// Check that removing them works
|
// Check that removing them works
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_stopInstanceToUpdate3(instanceName),
|
Config: testAccComputeInstance_stopInstanceToUpdate3(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -626,7 +626,7 @@ func TestAccComputeInstance_service_account(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_service_account(instanceName),
|
Config: testAccComputeInstance_service_account(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -655,7 +655,7 @@ func TestAccComputeInstance_scheduling(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_scheduling(instanceName),
|
Config: testAccComputeInstance_scheduling(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -678,7 +678,7 @@ func TestAccComputeInstance_subnet_auto(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_subnet_auto(instanceName),
|
Config: testAccComputeInstance_subnet_auto(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -702,7 +702,7 @@ func TestAccComputeInstance_subnet_custom(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_subnet_custom(instanceName),
|
Config: testAccComputeInstance_subnet_custom(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -729,7 +729,7 @@ func TestAccComputeInstance_subnet_xpn(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_subnet_xpn(org, billingId, projectName, instanceName),
|
Config: testAccComputeInstance_subnet_xpn(org, billingId, projectName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExistsInProject(
|
testAccCheckComputeInstanceExistsInProject(
|
||||||
|
@ -753,7 +753,7 @@ func TestAccComputeInstance_networkIPAuto(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_networkIPAuto(instanceName),
|
Config: testAccComputeInstance_networkIPAuto(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -776,7 +776,7 @@ func TestAccComputeInstance_network_ip_custom(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_network_ip_custom(instanceName, ipAddress),
|
Config: testAccComputeInstance_network_ip_custom(instanceName, ipAddress),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -801,7 +801,7 @@ func TestAccComputeInstance_private_image_family(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_private_image_family(diskName, familyName, instanceName),
|
Config: testAccComputeInstance_private_image_family(diskName, familyName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -823,7 +823,7 @@ func TestAccComputeInstance_forceChangeMachineTypeManually(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic(instanceName),
|
Config: testAccComputeInstance_basic(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -849,7 +849,7 @@ func TestAccComputeInstance_multiNic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_multiNic(instanceName, networkName, subnetworkName),
|
Config: testAccComputeInstance_multiNic(instanceName, networkName, subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -872,7 +872,7 @@ func TestAccComputeInstance_guestAccelerator(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_guestAccelerator(instanceName, 1),
|
Config: testAccComputeInstance_guestAccelerator(instanceName, 1),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -896,7 +896,7 @@ func TestAccComputeInstance_guestAcceleratorSkip(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_guestAccelerator(instanceName, 0),
|
Config: testAccComputeInstance_guestAccelerator(instanceName, 0),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -919,7 +919,7 @@ func TestAccComputeInstance_minCpuPlatform(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_minCpuPlatform(instanceName),
|
Config: testAccComputeInstance_minCpuPlatform(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -942,7 +942,7 @@ func TestAccComputeInstance_deletionProtectionExplicitFalse(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic_deletionProtectionFalse(instanceName),
|
Config: testAccComputeInstance_basic_deletionProtectionFalse(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -965,7 +965,7 @@ func TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse(t *test
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic_deletionProtectionTrue(instanceName),
|
Config: testAccComputeInstance_basic_deletionProtectionTrue(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -975,7 +975,7 @@ func TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse(t *test
|
||||||
},
|
},
|
||||||
computeInstanceImportStep("us-central1-a", instanceName, []string{"metadata.foo"}),
|
computeInstanceImportStep("us-central1-a", instanceName, []string{"metadata.foo"}),
|
||||||
// Update deletion_protection to false, otherwise the test harness can't delete the instance
|
// Update deletion_protection to false, otherwise the test harness can't delete the instance
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_basic_deletionProtectionFalse(instanceName),
|
Config: testAccComputeInstance_basic_deletionProtectionFalse(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists(
|
testAccCheckComputeInstanceExists(
|
||||||
|
@ -998,7 +998,7 @@ func TestAccComputeInstance_primaryAliasIpRange(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_primaryAliasIpRange(instanceName),
|
Config: testAccComputeInstance_primaryAliasIpRange(instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -1023,7 +1023,7 @@ func TestAccComputeInstance_secondaryAliasIpRange(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
CheckDestroy: testAccCheckComputeInstanceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_secondaryAliasIpRange(networkName, subnetName, instanceName),
|
Config: testAccComputeInstance_secondaryAliasIpRange(networkName, subnetName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -1031,7 +1031,7 @@ func TestAccComputeInstance_secondaryAliasIpRange(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
computeInstanceImportStep("us-east1-d", instanceName, []string{}),
|
computeInstanceImportStep("us-east1-d", instanceName, []string{}),
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeInstance_secondaryAliasIpRangeUpdate(networkName, subnetName, instanceName),
|
Config: testAccComputeInstance_secondaryAliasIpRangeUpdate(networkName, subnetName, instanceName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
testAccCheckComputeInstanceExists("google_compute_instance.foobar", &instance),
|
||||||
|
@ -1908,7 +1908,7 @@ resource "google_compute_instance" "foobar" {
|
||||||
|
|
||||||
func testAccComputeInstance_disks_encryption(bootEncryptionKey string, diskNameToEncryptionKey map[string]*compute.CustomerEncryptionKey, instance string) string {
|
func testAccComputeInstance_disks_encryption(bootEncryptionKey string, diskNameToEncryptionKey map[string]*compute.CustomerEncryptionKey, instance string) string {
|
||||||
diskNames := []string{}
|
diskNames := []string{}
|
||||||
for k, _ := range diskNameToEncryptionKey {
|
for k := range diskNameToEncryptionKey {
|
||||||
diskNames = append(diskNames, k)
|
diskNames = append(diskNames, k)
|
||||||
}
|
}
|
||||||
return fmt.Sprintf(`
|
return fmt.Sprintf(`
|
||||||
|
|
|
@ -19,37 +19,37 @@ func resourceComputeNetwork() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"auto_create_subnetworks": &schema.Schema{
|
"auto_create_subnetworks": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"routing_mode": &schema.Schema{
|
"routing_mode": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"gateway_ipv4": &schema.Schema{
|
"gateway_ipv4": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ipv4_range": &schema.Schema{
|
"ipv4_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -57,14 +57,14 @@ func resourceComputeNetwork() *schema.Resource {
|
||||||
Deprecated: "Please use google_compute_subnetwork resources instead.",
|
Deprecated: "Please use google_compute_subnetwork resources instead.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,37 +19,37 @@ func resourceComputeNetworkPeering() *schema.Resource {
|
||||||
Delete: resourceComputeNetworkPeeringDelete,
|
Delete: resourceComputeNetworkPeeringDelete,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateGCPName,
|
ValidateFunc: validateGCPName,
|
||||||
},
|
},
|
||||||
"network": &schema.Schema{
|
"network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateRegexp(peerNetworkLinkRegex),
|
ValidateFunc: validateRegexp(peerNetworkLinkRegex),
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
"peer_network": &schema.Schema{
|
"peer_network": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateRegexp(peerNetworkLinkRegex),
|
ValidateFunc: validateRegexp(peerNetworkLinkRegex),
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
"auto_create_routes": &schema.Schema{
|
"auto_create_routes": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
},
|
},
|
||||||
"state": &schema.Schema{
|
"state": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"state_details": &schema.Schema{
|
"state_details": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,7 +20,7 @@ func TestAccComputeNetworkPeering_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccComputeNetworkPeeringDestroy,
|
CheckDestroy: testAccComputeNetworkPeeringDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetworkPeering_basic(),
|
Config: testAccComputeNetworkPeering_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkPeeringExist("google_compute_network_peering.foo", &peering),
|
testAccCheckComputeNetworkPeeringExist("google_compute_network_peering.foo", &peering),
|
||||||
|
|
|
@ -20,14 +20,14 @@ func TestAccComputeNetwork_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetwork_basic(),
|
Config: testAccComputeNetwork_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkExists(
|
testAccCheckComputeNetworkExists(
|
||||||
"google_compute_network.foobar", &network),
|
"google_compute_network.foobar", &network),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_network.foobar",
|
ResourceName: "google_compute_network.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -46,7 +46,7 @@ func TestAccComputeNetwork_auto_subnet(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetwork_auto_subnet(),
|
Config: testAccComputeNetwork_auto_subnet(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkExists(
|
testAccCheckComputeNetworkExists(
|
||||||
|
@ -55,7 +55,7 @@ func TestAccComputeNetwork_auto_subnet(t *testing.T) {
|
||||||
"google_compute_network.bar", &network),
|
"google_compute_network.bar", &network),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_network.bar",
|
ResourceName: "google_compute_network.bar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -74,7 +74,7 @@ func TestAccComputeNetwork_custom_subnet(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetwork_custom_subnet(),
|
Config: testAccComputeNetwork_custom_subnet(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkExists(
|
testAccCheckComputeNetworkExists(
|
||||||
|
@ -83,7 +83,7 @@ func TestAccComputeNetwork_custom_subnet(t *testing.T) {
|
||||||
"google_compute_network.baz", &network),
|
"google_compute_network.baz", &network),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_network.baz",
|
ResourceName: "google_compute_network.baz",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -102,7 +102,7 @@ func TestAccComputeNetwork_routing_mode(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetwork_routing_mode("GLOBAL"),
|
Config: testAccComputeNetwork_routing_mode("GLOBAL"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkExists(
|
testAccCheckComputeNetworkExists(
|
||||||
|
@ -112,7 +112,7 @@ func TestAccComputeNetwork_routing_mode(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// Test updating the routing field (only updateable field).
|
// Test updating the routing field (only updateable field).
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetwork_routing_mode("REGIONAL"),
|
Config: testAccComputeNetwork_routing_mode("REGIONAL"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkExists(
|
testAccCheckComputeNetworkExists(
|
||||||
|
@ -137,7 +137,7 @@ func TestAccComputeNetwork_default_routing_mode(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
CheckDestroy: testAccCheckComputeNetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeNetwork_basic(),
|
Config: testAccComputeNetwork_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeNetworkExists(
|
testAccCheckComputeNetworkExists(
|
||||||
|
|
|
@ -21,13 +21,13 @@ func resourceComputeProjectMetadata() *schema.Resource {
|
||||||
SchemaVersion: 0,
|
SchemaVersion: 0,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"metadata": &schema.Schema{
|
"metadata": {
|
||||||
Type: schema.TypeMap,
|
Type: schema.TypeMap,
|
||||||
Required: true,
|
Required: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -22,10 +22,10 @@ func TestAccComputeProjectMetadata_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeProjectMetadataDestroy,
|
CheckDestroy: testAccCheckComputeProjectMetadataDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeProject_basic0_metadata(projectID, pname, org, billingId),
|
Config: testAccComputeProject_basic0_metadata(projectID, pname, org, billingId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -47,19 +47,19 @@ func TestAccComputeProjectMetadata_modify_1(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeProjectMetadataDestroy,
|
CheckDestroy: testAccCheckComputeProjectMetadataDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeProject_modify0_metadata(projectID, pname, org, billingId),
|
Config: testAccComputeProject_modify0_metadata(projectID, pname, org, billingId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeProject_modify1_metadata(projectID, pname, org, billingId),
|
Config: testAccComputeProject_modify1_metadata(projectID, pname, org, billingId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -81,19 +81,19 @@ func TestAccComputeProjectMetadata_modify_2(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeProjectMetadataDestroy,
|
CheckDestroy: testAccCheckComputeProjectMetadataDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeProject_basic0_metadata(projectID, pname, org, billingId),
|
Config: testAccComputeProject_basic0_metadata(projectID, pname, org, billingId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeProject_basic1_metadata(projectID, pname, org, billingId),
|
Config: testAccComputeProject_basic1_metadata(projectID, pname, org, billingId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
ResourceName: "google_compute_project_metadata.fizzbuzz",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -24,14 +24,14 @@ func TestAccComputeRegionAutoscaler_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionAutoscalerDestroy,
|
CheckDestroy: testAccCheckComputeRegionAutoscalerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeRegionAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionAutoscalerExists(
|
testAccCheckComputeRegionAutoscalerExists(
|
||||||
"google_compute_region_autoscaler.foobar", &ascaler),
|
"google_compute_region_autoscaler.foobar", &ascaler),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_region_autoscaler.foobar",
|
ResourceName: "google_compute_region_autoscaler.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -53,14 +53,14 @@ func TestAccComputeRegionAutoscaler_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionAutoscalerDestroy,
|
CheckDestroy: testAccCheckComputeRegionAutoscalerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeRegionAutoscaler_basic(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionAutoscalerExists(
|
testAccCheckComputeRegionAutoscalerExists(
|
||||||
"google_compute_region_autoscaler.foobar", &ascaler),
|
"google_compute_region_autoscaler.foobar", &ascaler),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionAutoscaler_update(it_name, tp_name, igm_name, autoscaler_name),
|
Config: testAccComputeRegionAutoscaler_update(it_name, tp_name, igm_name, autoscaler_name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionAutoscalerExists(
|
testAccCheckComputeRegionAutoscalerExists(
|
||||||
|
|
|
@ -19,14 +19,14 @@ func resourceComputeRegionBackendService() *schema.Resource {
|
||||||
Delete: resourceComputeRegionBackendServiceDelete,
|
Delete: resourceComputeRegionBackendServiceDelete,
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateGCPName,
|
ValidateFunc: validateGCPName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"health_checks": &schema.Schema{
|
"health_checks": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
Set: schema.HashString,
|
Set: schema.HashString,
|
||||||
|
@ -35,16 +35,16 @@ func resourceComputeRegionBackendService() *schema.Resource {
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
"backend": &schema.Schema{
|
"backend": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"group": &schema.Schema{
|
"group": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
@ -54,54 +54,54 @@ func resourceComputeRegionBackendService() *schema.Resource {
|
||||||
Set: resourceGoogleComputeRegionBackendServiceBackendHash,
|
Set: resourceGoogleComputeRegionBackendServiceBackendHash,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"fingerprint": &schema.Schema{
|
"fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"protocol": &schema.Schema{
|
"protocol": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"session_affinity": &schema.Schema{
|
"session_affinity": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"timeout_sec": &schema.Schema{
|
"timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"connection_draining_timeout_sec": &schema.Schema{
|
"connection_draining_timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: 0,
|
Default: 0,
|
||||||
|
|
|
@ -23,14 +23,14 @@ func TestAccComputeRegionBackendService_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_basic(serviceName, checkName),
|
Config: testAccComputeRegionBackendService_basic(serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionBackendServiceExists(
|
testAccCheckComputeRegionBackendServiceExists(
|
||||||
"google_compute_region_backend_service.foobar", &svc),
|
"google_compute_region_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_basicModified(
|
Config: testAccComputeRegionBackendService_basicModified(
|
||||||
serviceName, checkName, extraCheckName),
|
serviceName, checkName, extraCheckName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -55,7 +55,7 @@ func TestAccComputeRegionBackendService_withBackend(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_withBackend(
|
Config: testAccComputeRegionBackendService_withBackend(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -90,7 +90,7 @@ func TestAccComputeRegionBackendService_withBackendAndUpdate(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_withBackend(
|
Config: testAccComputeRegionBackendService_withBackend(
|
||||||
serviceName, igName, itName, checkName, 10),
|
serviceName, igName, itName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -98,7 +98,7 @@ func TestAccComputeRegionBackendService_withBackendAndUpdate(t *testing.T) {
|
||||||
"google_compute_region_backend_service.lipsum", &svc),
|
"google_compute_region_backend_service.lipsum", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_withBackend(
|
Config: testAccComputeRegionBackendService_withBackend(
|
||||||
serviceName, igName, itName, checkName, 20),
|
serviceName, igName, itName, checkName, 20),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -132,7 +132,7 @@ func TestAccComputeRegionBackendService_withConnectionDraining(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_withConnectionDraining(serviceName, checkName, 10),
|
Config: testAccComputeRegionBackendService_withConnectionDraining(serviceName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionBackendServiceExists(
|
testAccCheckComputeRegionBackendServiceExists(
|
||||||
|
@ -159,14 +159,14 @@ func TestAccComputeRegionBackendService_withConnectionDrainingAndUpdate(t *testi
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_withConnectionDraining(serviceName, checkName, 10),
|
Config: testAccComputeRegionBackendService_withConnectionDraining(serviceName, checkName, 10),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionBackendServiceExists(
|
testAccCheckComputeRegionBackendServiceExists(
|
||||||
"google_compute_region_backend_service.foobar", &svc),
|
"google_compute_region_backend_service.foobar", &svc),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_basic(serviceName, checkName),
|
Config: testAccComputeRegionBackendService_basic(serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionBackendServiceExists(
|
testAccCheckComputeRegionBackendServiceExists(
|
||||||
|
@ -193,7 +193,7 @@ func TestAccComputeRegionBackendService_withSessionAffinity(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
CheckDestroy: testAccCheckComputeRegionBackendServiceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionBackendService_withSessionAffinity(
|
Config: testAccComputeRegionBackendService_withSessionAffinity(
|
||||||
serviceName, checkName),
|
serviceName, checkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
|
|
@ -23,26 +23,26 @@ func TestAccComputeRegionDisk_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_basic(diskName, "self_link"),
|
Config: testAccComputeRegionDisk_basic(diskName, "self_link"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
"google_compute_region_disk.regiondisk", &disk),
|
"google_compute_region_disk.regiondisk", &disk),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_region_disk.regiondisk",
|
ResourceName: "google_compute_region_disk.regiondisk",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_basic(diskName, "name"),
|
Config: testAccComputeRegionDisk_basic(diskName, "name"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
"google_compute_region_disk.regiondisk", &disk),
|
"google_compute_region_disk.regiondisk", &disk),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_region_disk.regiondisk",
|
ResourceName: "google_compute_region_disk.regiondisk",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -63,19 +63,19 @@ func TestAccComputeRegionDisk_basicUpdate(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_basic(diskName, "self_link"),
|
Config: testAccComputeRegionDisk_basic(diskName, "self_link"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
"google_compute_region_disk.regiondisk", &disk),
|
"google_compute_region_disk.regiondisk", &disk),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_region_disk.regiondisk",
|
ResourceName: "google_compute_region_disk.regiondisk",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_basicUpdated(diskName, "self_link"),
|
Config: testAccComputeRegionDisk_basicUpdated(diskName, "self_link"),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
|
@ -86,7 +86,7 @@ func TestAccComputeRegionDisk_basicUpdate(t *testing.T) {
|
||||||
testAccCheckComputeRegionDiskHasLabelFingerprint(&disk, "google_compute_region_disk.regiondisk"),
|
testAccCheckComputeRegionDiskHasLabelFingerprint(&disk, "google_compute_region_disk.regiondisk"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_region_disk.regiondisk",
|
ResourceName: "google_compute_region_disk.regiondisk",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -106,7 +106,7 @@ func TestAccComputeRegionDisk_encryption(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_encryption(diskName),
|
Config: testAccComputeRegionDisk_encryption(diskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
|
@ -133,7 +133,7 @@ func TestAccComputeRegionDisk_deleteDetach(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
CheckDestroy: testAccCheckComputeRegionDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName),
|
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
|
@ -144,7 +144,7 @@ func TestAccComputeRegionDisk_deleteDetach(t *testing.T) {
|
||||||
// listed as attached to the disk; the instance is created after the
|
// listed as attached to the disk; the instance is created after the
|
||||||
// disk. and the disk's properties aren't refreshed unless there's
|
// disk. and the disk's properties aren't refreshed unless there's
|
||||||
// another step
|
// another step
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName),
|
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
|
@ -154,7 +154,7 @@ func TestAccComputeRegionDisk_deleteDetach(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// Change the disk name to destroy it, which detaches it from the instance
|
// Change the disk name to destroy it, which detaches it from the instance
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName2),
|
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName2),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
|
@ -162,7 +162,7 @@ func TestAccComputeRegionDisk_deleteDetach(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// Add the extra step like before
|
// Add the extra step like before
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName2),
|
Config: testAccComputeRegionDisk_deleteDetach(instanceName, diskName, regionDiskName2),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRegionDiskExists(
|
testAccCheckComputeRegionDiskExists(
|
||||||
|
|
|
@ -36,52 +36,52 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"base_instance_name": &schema.Schema{
|
"base_instance_name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_template": &schema.Schema{
|
"instance_template": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"version": &schema.Schema{
|
"version": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_template": &schema.Schema{
|
"instance_template": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"target_size": &schema.Schema{
|
"target_size": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"fixed": &schema.Schema{
|
"fixed": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"percent": &schema.Schema{
|
"percent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
|
@ -94,45 +94,45 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"fingerprint": &schema.Schema{
|
"fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"instance_group": &schema.Schema{
|
"instance_group": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"named_port": &schema.Schema{
|
"named_port": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"port": &schema.Schema{
|
"port": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
@ -140,26 +140,26 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"update_strategy": &schema.Schema{
|
"update_strategy": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Deprecated: "This field is removed.",
|
Deprecated: "This field is removed.",
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"target_pools": &schema.Schema{
|
"target_pools": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Elem: &schema.Schema{
|
Elem: &schema.Schema{
|
||||||
|
@ -167,7 +167,7 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
Set: selfLinkRelativePathHash,
|
Set: selfLinkRelativePathHash,
|
||||||
},
|
},
|
||||||
"target_size": &schema.Schema{
|
"target_size": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -176,27 +176,27 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
// If true, the resource will report ready only after no instances are being created.
|
// If true, the resource will report ready only after no instances are being created.
|
||||||
// This will not block future reads if instances are being recreated, and it respects
|
// This will not block future reads if instances are being recreated, and it respects
|
||||||
// the "createNoRetry" parameter that's available for this resource.
|
// the "createNoRetry" parameter that's available for this resource.
|
||||||
"wait_for_instances": &schema.Schema{
|
"wait_for_instances": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
"auto_healing_policies": &schema.Schema{
|
"auto_healing_policies": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"health_check": &schema.Schema{
|
"health_check": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
DiffSuppressFunc: compareSelfLinkRelativePaths,
|
||||||
},
|
},
|
||||||
|
|
||||||
"initial_delay_sec": &schema.Schema{
|
"initial_delay_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
|
@ -206,7 +206,7 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"distribution_policy_zones": &schema.Schema{
|
"distribution_policy_zones": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -218,7 +218,7 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"rolling_update_policy": &schema.Schema{
|
"rolling_update_policy": {
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
|
@ -226,48 +226,48 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"minimal_action": &schema.Schema{
|
"minimal_action": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.StringInSlice([]string{"RESTART", "REPLACE"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"RESTART", "REPLACE"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"type": &schema.Schema{
|
"type": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.StringInSlice([]string{"OPPORTUNISTIC", "PROACTIVE"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"OPPORTUNISTIC", "PROACTIVE"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_surge_fixed": &schema.Schema{
|
"max_surge_fixed": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_surge_percent": &schema.Schema{
|
"max_surge_percent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.IntBetween(0, 100),
|
ValidateFunc: validation.IntBetween(0, 100),
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_unavailable_fixed": &schema.Schema{
|
"max_unavailable_fixed": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
},
|
},
|
||||||
|
|
||||||
"max_unavailable_percent": &schema.Schema{
|
"max_unavailable_percent": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
ValidateFunc: validation.IntBetween(0, 100),
|
ValidateFunc: validation.IntBetween(0, 100),
|
||||||
},
|
},
|
||||||
|
|
||||||
"min_ready_sec": &schema.Schema{
|
"min_ready_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
Removed: "This field is in beta. Use it in the the google-beta provider instead. See https://terraform.io/docs/providers/google/provider_versions.html for more details.",
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
|
|
@ -139,7 +139,7 @@ func TestAccRegionInstanceGroupManager_updateStrategy(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckInstanceGroupManagerDestroy,
|
CheckDestroy: testAccCheckInstanceGroupManagerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccRegionInstanceGroupManager_updateStrategy(igm),
|
Config: testAccRegionInstanceGroupManager_updateStrategy(igm),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,7 +104,7 @@ func resourceComputeRoute() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"next_hop_instance_zone": &schema.Schema{
|
"next_hop_instance_zone": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -21,7 +21,7 @@ func TestAccComputeRoute_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouteDestroy,
|
CheckDestroy: testAccCheckComputeRouteDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRoute_basic(),
|
Config: testAccComputeRoute_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRouteExists(
|
testAccCheckComputeRouteExists(
|
||||||
|
@ -30,7 +30,7 @@ func TestAccComputeRoute_basic(t *testing.T) {
|
||||||
"google_compute_route.foobar", "description", regexp.MustCompile("This is a route")),
|
"google_compute_route.foobar", "description", regexp.MustCompile("This is a route")),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_route.foobar",
|
ResourceName: "google_compute_route.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -49,14 +49,14 @@ func TestAccComputeRoute_defaultInternetGateway(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouteDestroy,
|
CheckDestroy: testAccCheckComputeRouteDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRoute_defaultInternetGateway(),
|
Config: testAccComputeRoute_defaultInternetGateway(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRouteExists(
|
testAccCheckComputeRouteExists(
|
||||||
"google_compute_route.foobar", &route),
|
"google_compute_route.foobar", &route),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_route.foobar",
|
ResourceName: "google_compute_route.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -77,7 +77,7 @@ func TestAccComputeRoute_hopInstance(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouteDestroy,
|
CheckDestroy: testAccCheckComputeRouteDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRoute_hopInstance(instanceName, zone),
|
Config: testAccComputeRoute_hopInstance(instanceName, zone),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeRouteExists(
|
testAccCheckComputeRouteExists(
|
||||||
|
@ -86,7 +86,7 @@ func TestAccComputeRoute_hopInstance(t *testing.T) {
|
||||||
resource.TestMatchResourceAttr("google_compute_route.foobar", "next_hop_instance", instanceNameRegexp),
|
resource.TestMatchResourceAttr("google_compute_route.foobar", "next_hop_instance", instanceNameRegexp),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_route.foobar",
|
ResourceName: "google_compute_route.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -21,36 +21,36 @@ func resourceComputeRouterInterface() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"router": &schema.Schema{
|
"router": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"vpn_tunnel": &schema.Schema{
|
"vpn_tunnel": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
DiffSuppressFunc: linkDiffSuppress,
|
DiffSuppressFunc: linkDiffSuppress,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_range": &schema.Schema{
|
"ip_range": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -18,17 +18,17 @@ func TestAccComputeRouterInterface_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterInterfaceDestroy,
|
CheckDestroy: testAccCheckComputeRouterInterfaceDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterInterfaceBasic(testId),
|
Config: testAccComputeRouterInterfaceBasic(testId),
|
||||||
Check: testAccCheckComputeRouterInterfaceExists(
|
Check: testAccCheckComputeRouterInterfaceExists(
|
||||||
"google_compute_router_interface.foobar"),
|
"google_compute_router_interface.foobar"),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router_interface.foobar",
|
ResourceName: "google_compute_router_interface.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterInterfaceKeepRouter(testId),
|
Config: testAccComputeRouterInterfaceKeepRouter(testId),
|
||||||
Check: testAccCheckComputeRouterInterfaceDelete(
|
Check: testAccCheckComputeRouterInterfaceDelete(
|
||||||
"google_compute_router_interface.foobar"),
|
"google_compute_router_interface.foobar"),
|
||||||
|
|
|
@ -17,18 +17,18 @@ import (
|
||||||
var (
|
var (
|
||||||
routerNatSubnetworkConfig = &schema.Resource{
|
routerNatSubnetworkConfig = &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"source_ip_ranges_to_nat": &schema.Schema{
|
"source_ip_ranges_to_nat": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
"secondary_ip_range_names": &schema.Schema{
|
"secondary_ip_range_names": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
@ -54,73 +54,73 @@ func resourceComputeRouterNat() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateRFC1035Name(2, 63),
|
ValidateFunc: validateRFC1035Name(2, 63),
|
||||||
},
|
},
|
||||||
"router": &schema.Schema{
|
"router": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"nat_ip_allocate_option": &schema.Schema{
|
"nat_ip_allocate_option": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"MANUAL_ONLY", "AUTO_ONLY"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"MANUAL_ONLY", "AUTO_ONLY"}, false),
|
||||||
},
|
},
|
||||||
"nat_ips": &schema.Schema{
|
"nat_ips": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: &schema.Schema{Type: schema.TypeString},
|
Elem: &schema.Schema{Type: schema.TypeString},
|
||||||
},
|
},
|
||||||
"source_subnetwork_ip_ranges_to_nat": &schema.Schema{
|
"source_subnetwork_ip_ranges_to_nat": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"ALL_SUBNETWORKS_ALL_IP_RANGES", "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES", "LIST_OF_SUBNETWORKS"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"ALL_SUBNETWORKS_ALL_IP_RANGES", "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES", "LIST_OF_SUBNETWORKS"}, false),
|
||||||
},
|
},
|
||||||
"subnetwork": &schema.Schema{
|
"subnetwork": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
Elem: routerNatSubnetworkConfig,
|
Elem: routerNatSubnetworkConfig,
|
||||||
},
|
},
|
||||||
"min_ports_per_vm": &schema.Schema{
|
"min_ports_per_vm": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"udp_idle_timeout_sec": &schema.Schema{
|
"udp_idle_timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"icmp_idle_timeout_sec": &schema.Schema{
|
"icmp_idle_timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"tcp_established_idle_timeout_sec": &schema.Schema{
|
"tcp_established_idle_timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"tcp_transitory_idle_timeout_sec": &schema.Schema{
|
"tcp_transitory_idle_timeout_sec": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -18,15 +18,15 @@ func TestAccComputeRouterNat_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterNatDestroy,
|
CheckDestroy: testAccCheckComputeRouterNatDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterNatBasic(testId),
|
Config: testAccComputeRouterNatBasic(testId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router_nat.foobar",
|
ResourceName: "google_compute_router_nat.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterNatKeepRouter(testId),
|
Config: testAccComputeRouterNatKeepRouter(testId),
|
||||||
Check: testAccCheckComputeRouterNatDelete(
|
Check: testAccCheckComputeRouterNatDelete(
|
||||||
"google_compute_router_nat.foobar"),
|
"google_compute_router_nat.foobar"),
|
||||||
|
@ -44,10 +44,10 @@ func TestAccComputeRouterNat_withManualIpAndSubnetConfiguration(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterNatDestroy,
|
CheckDestroy: testAccCheckComputeRouterNatDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterNatWithManualIpAndSubnetConfiguration(testId),
|
Config: testAccComputeRouterNatWithManualIpAndSubnetConfiguration(testId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router_nat.foobar",
|
ResourceName: "google_compute_router_nat.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -21,53 +21,53 @@ func resourceComputeRouterPeer() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"router": &schema.Schema{
|
"router": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"interface": &schema.Schema{
|
"interface": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"peer_ip_address": &schema.Schema{
|
"peer_ip_address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"peer_asn": &schema.Schema{
|
"peer_asn": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"advertised_route_priority": &schema.Schema{
|
"advertised_route_priority": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"ip_address": &schema.Schema{
|
"ip_address": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"region": &schema.Schema{
|
"region": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
|
|
|
@ -18,17 +18,17 @@ func TestAccComputeRouterPeer_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterPeerDestroy,
|
CheckDestroy: testAccCheckComputeRouterPeerDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterPeerBasic(testId),
|
Config: testAccComputeRouterPeerBasic(testId),
|
||||||
Check: testAccCheckComputeRouterPeerExists(
|
Check: testAccCheckComputeRouterPeerExists(
|
||||||
"google_compute_router_peer.foobar"),
|
"google_compute_router_peer.foobar"),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router_peer.foobar",
|
ResourceName: "google_compute_router_peer.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterPeerKeepRouter(testId),
|
Config: testAccComputeRouterPeerKeepRouter(testId),
|
||||||
Check: testAccCheckComputeRouterPeerDelete(
|
Check: testAccCheckComputeRouterPeerDelete(
|
||||||
"google_compute_router_peer.foobar"),
|
"google_compute_router_peer.foobar"),
|
||||||
|
|
|
@ -18,10 +18,10 @@ func TestAccComputeRouter_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterDestroy,
|
CheckDestroy: testAccCheckComputeRouterDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterBasic(testId, resourceRegion),
|
Config: testAccComputeRouterBasic(testId, resourceRegion),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router.foobar",
|
ResourceName: "google_compute_router.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -40,10 +40,10 @@ func TestAccComputeRouter_noRegion(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterDestroy,
|
CheckDestroy: testAccCheckComputeRouterDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterNoRegion(testId, providerRegion),
|
Config: testAccComputeRouterNoRegion(testId, providerRegion),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router.foobar",
|
ResourceName: "google_compute_router.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -61,10 +61,10 @@ func TestAccComputeRouter_full(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterDestroy,
|
CheckDestroy: testAccCheckComputeRouterDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterFull(testId),
|
Config: testAccComputeRouterFull(testId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router.foobar",
|
ResourceName: "google_compute_router.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -83,26 +83,26 @@ func TestAccComputeRouter_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeRouterDestroy,
|
CheckDestroy: testAccCheckComputeRouterDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterBasic(testId, region),
|
Config: testAccComputeRouterBasic(testId, region),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router.foobar",
|
ResourceName: "google_compute_router.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterFull(testId),
|
Config: testAccComputeRouterFull(testId),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router.foobar",
|
ResourceName: "google_compute_router.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeRouterBasic(testId, region),
|
Config: testAccComputeRouterBasic(testId, region),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_router.foobar",
|
ResourceName: "google_compute_router.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -29,55 +29,55 @@ func resourceComputeSecurityPolicy() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
ValidateFunc: validateGCPName,
|
ValidateFunc: validateGCPName,
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"rule": &schema.Schema{
|
"rule": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true, // If no rules are set, a default rule is added
|
Computed: true, // If no rules are set, a default rule is added
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"action": &schema.Schema{
|
"action": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"allow", "deny(403)", "deny(404)", "deny(502)"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"allow", "deny(403)", "deny(404)", "deny(502)"}, false),
|
||||||
},
|
},
|
||||||
|
|
||||||
"priority": &schema.Schema{
|
"priority": {
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
Required: true,
|
Required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"match": &schema.Schema{
|
"match": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Required: true,
|
Required: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"config": &schema.Schema{
|
"config": {
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
Required: true,
|
Required: true,
|
||||||
MaxItems: 1,
|
MaxItems: 1,
|
||||||
Elem: &schema.Resource{
|
Elem: &schema.Resource{
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"src_ip_ranges": &schema.Schema{
|
"src_ip_ranges": {
|
||||||
Type: schema.TypeSet,
|
Type: schema.TypeSet,
|
||||||
Required: true,
|
Required: true,
|
||||||
MinItems: 1,
|
MinItems: 1,
|
||||||
|
@ -88,7 +88,7 @@ func resourceComputeSecurityPolicy() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"versioned_expr": &schema.Schema{
|
"versioned_expr": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ValidateFunc: validation.StringInSlice([]string{"SRC_IPS_V1"}, false),
|
ValidateFunc: validation.StringInSlice([]string{"SRC_IPS_V1"}, false),
|
||||||
|
@ -97,12 +97,12 @@ func resourceComputeSecurityPolicy() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"description": &schema.Schema{
|
"description": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"preview": &schema.Schema{
|
"preview": {
|
||||||
Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
@ -110,12 +110,12 @@ func resourceComputeSecurityPolicy() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"fingerprint": &schema.Schema{
|
"fingerprint": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"self_link": &schema.Schema{
|
"self_link": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,10 +19,10 @@ func TestAccComputeSecurityPolicy_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSecurityPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSecurityPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSecurityPolicy_basic(spName),
|
Config: testAccComputeSecurityPolicy_basic(spName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_security_policy.policy",
|
ResourceName: "google_compute_security_policy.policy",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -41,10 +41,10 @@ func TestAccComputeSecurityPolicy_withRule(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSecurityPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSecurityPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSecurityPolicy_withRule(spName),
|
Config: testAccComputeSecurityPolicy_withRule(spName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_security_policy.policy",
|
ResourceName: "google_compute_security_policy.policy",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -63,28 +63,28 @@ func TestAccComputeSecurityPolicy_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSecurityPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSecurityPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSecurityPolicy_withRule(spName),
|
Config: testAccComputeSecurityPolicy_withRule(spName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_security_policy.policy",
|
ResourceName: "google_compute_security_policy.policy",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSecurityPolicy_update(spName),
|
Config: testAccComputeSecurityPolicy_update(spName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_security_policy.policy",
|
ResourceName: "google_compute_security_policy.policy",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSecurityPolicy_withRule(spName),
|
Config: testAccComputeSecurityPolicy_withRule(spName),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_security_policy.policy",
|
ResourceName: "google_compute_security_policy.policy",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -17,7 +17,7 @@ func resourceComputeSharedVpcHostProject() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"project": &schema.Schema{
|
"project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -22,12 +22,12 @@ func resourceComputeSharedVpcServiceProject() *schema.Resource {
|
||||||
},
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"host_project": &schema.Schema{
|
"host_project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"service_project": &schema.Schema{
|
"service_project": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
ForceNew: true,
|
ForceNew: true,
|
||||||
|
|
|
@ -23,7 +23,7 @@ func TestAccComputeSharedVpc_basic(t *testing.T) {
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSharedVpc_basic(hostProject, serviceProject, org, billingId),
|
Config: testAccComputeSharedVpc_basic(hostProject, serviceProject, org, billingId),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSharedVpcHostProject(hostProject, true),
|
testAccCheckComputeSharedVpcHostProject(hostProject, true),
|
||||||
|
@ -31,18 +31,18 @@ func TestAccComputeSharedVpc_basic(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// Test import.
|
// Test import.
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: hostProjectResourceName,
|
ResourceName: hostProjectResourceName,
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: serviceProjectResourceName,
|
ResourceName: serviceProjectResourceName,
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
// Use a separate TestStep rather than a CheckDestroy because we need the project to still exist.
|
// Use a separate TestStep rather than a CheckDestroy because we need the project to still exist.
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSharedVpc_disabled(hostProject, serviceProject, org, billingId),
|
Config: testAccComputeSharedVpc_disabled(hostProject, serviceProject, org, billingId),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSharedVpcHostProject(hostProject, false),
|
testAccCheckComputeSharedVpcHostProject(hostProject, false),
|
||||||
|
|
|
@ -17,14 +17,14 @@ func TestAccComputeSslCertificate_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslCertificateDestroy,
|
CheckDestroy: testAccCheckComputeSslCertificateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslCertificate_basic(),
|
Config: testAccComputeSslCertificate_basic(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslCertificateExists(
|
testAccCheckComputeSslCertificateExists(
|
||||||
"google_compute_ssl_certificate.foobar"),
|
"google_compute_ssl_certificate.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_certificate.foobar",
|
ResourceName: "google_compute_ssl_certificate.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -42,14 +42,14 @@ func TestAccComputeSslCertificate_no_name(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslCertificateDestroy,
|
CheckDestroy: testAccCheckComputeSslCertificateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslCertificate_no_name(),
|
Config: testAccComputeSslCertificate_no_name(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslCertificateExists(
|
testAccCheckComputeSslCertificateExists(
|
||||||
"google_compute_ssl_certificate.foobar"),
|
"google_compute_ssl_certificate.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_certificate.foobar",
|
ResourceName: "google_compute_ssl_certificate.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -67,14 +67,14 @@ func TestAccComputeSslCertificate_name_prefix(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslCertificateDestroy,
|
CheckDestroy: testAccCheckComputeSslCertificateDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslCertificate_name_prefix(),
|
Config: testAccComputeSslCertificate_name_prefix(),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslCertificateExists(
|
testAccCheckComputeSslCertificateExists(
|
||||||
"google_compute_ssl_certificate.foobar"),
|
"google_compute_ssl_certificate.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_certificate.foobar",
|
ResourceName: "google_compute_ssl_certificate.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -21,7 +21,7 @@ func TestAccComputeSslPolicy_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslPolicyBasic(sslPolicyName),
|
Config: testAccComputeSslPolicyBasic(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -33,7 +33,7 @@ func TestAccComputeSslPolicy_basic(t *testing.T) {
|
||||||
"google_compute_ssl_policy.basic", "min_tls_version", "TLS_1_0"),
|
"google_compute_ssl_policy.basic", "min_tls_version", "TLS_1_0"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.basic",
|
ResourceName: "google_compute_ssl_policy.basic",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -53,7 +53,7 @@ func TestAccComputeSslPolicy_profile(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslPolicyProfile(sslPolicyName),
|
Config: testAccComputeSslPolicyProfile(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -62,7 +62,7 @@ func TestAccComputeSslPolicy_profile(t *testing.T) {
|
||||||
"google_compute_ssl_policy.profile", "profile", "MODERN"),
|
"google_compute_ssl_policy.profile", "profile", "MODERN"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.profile",
|
ResourceName: "google_compute_ssl_policy.profile",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -82,7 +82,7 @@ func TestAccComputeSslPolicy_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslUpdate1(sslPolicyName),
|
Config: testAccComputeSslUpdate1(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -93,12 +93,12 @@ func TestAccComputeSslPolicy_update(t *testing.T) {
|
||||||
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_0"),
|
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_0"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.update",
|
ResourceName: "google_compute_ssl_policy.update",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslUpdate2(sslPolicyName),
|
Config: testAccComputeSslUpdate2(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -109,7 +109,7 @@ func TestAccComputeSslPolicy_update(t *testing.T) {
|
||||||
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_2"),
|
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_2"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.update",
|
ResourceName: "google_compute_ssl_policy.update",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -129,7 +129,7 @@ func TestAccComputeSslPolicy_tls_version(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslPolicyTlsVersion(sslPolicyName),
|
Config: testAccComputeSslPolicyTlsVersion(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -138,7 +138,7 @@ func TestAccComputeSslPolicy_tls_version(t *testing.T) {
|
||||||
"google_compute_ssl_policy.tlsversion", "min_tls_version", "TLS_1_2"),
|
"google_compute_ssl_policy.tlsversion", "min_tls_version", "TLS_1_2"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.tlsversion",
|
ResourceName: "google_compute_ssl_policy.tlsversion",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -158,7 +158,7 @@ func TestAccComputeSslPolicy_custom(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslPolicyCustom(sslPolicyName),
|
Config: testAccComputeSslPolicyCustom(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -169,7 +169,7 @@ func TestAccComputeSslPolicy_custom(t *testing.T) {
|
||||||
"google_compute_ssl_policy.custom", "profile", "CUSTOM"),
|
"google_compute_ssl_policy.custom", "profile", "CUSTOM"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.custom",
|
ResourceName: "google_compute_ssl_policy.custom",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -189,7 +189,7 @@ func TestAccComputeSslPolicy_update_to_custom(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslUpdate1(sslPolicyName),
|
Config: testAccComputeSslUpdate1(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -200,12 +200,12 @@ func TestAccComputeSslPolicy_update_to_custom(t *testing.T) {
|
||||||
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_0"),
|
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_0"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.update",
|
ResourceName: "google_compute_ssl_policy.update",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslUpdate3(sslPolicyName),
|
Config: testAccComputeSslUpdate3(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -216,7 +216,7 @@ func TestAccComputeSslPolicy_update_to_custom(t *testing.T) {
|
||||||
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_1"),
|
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_1"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.update",
|
ResourceName: "google_compute_ssl_policy.update",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -236,7 +236,7 @@ func TestAccComputeSslPolicy_update_from_custom(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
CheckDestroy: testAccCheckComputeSslPolicyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslUpdate3(sslPolicyName),
|
Config: testAccComputeSslUpdate3(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -247,12 +247,12 @@ func TestAccComputeSslPolicy_update_from_custom(t *testing.T) {
|
||||||
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_1"),
|
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_1"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.update",
|
ResourceName: "google_compute_ssl_policy.update",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSslUpdate1(sslPolicyName),
|
Config: testAccComputeSslUpdate1(sslPolicyName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSslPolicyExists(
|
testAccCheckComputeSslPolicyExists(
|
||||||
|
@ -263,7 +263,7 @@ func TestAccComputeSslPolicy_update_from_custom(t *testing.T) {
|
||||||
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_0"),
|
"google_compute_ssl_policy.update", "min_tls_version", "TLS_1_0"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_ssl_policy.update",
|
ResourceName: "google_compute_ssl_policy.update",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
|
|
@ -64,7 +64,7 @@ func TestAccComputeSubnetwork_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSubnetworkDestroy,
|
CheckDestroy: testAccCheckComputeSubnetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSubnetwork_basic(cnName, subnetwork1Name, subnetwork2Name, subnetwork3Name),
|
Config: testAccComputeSubnetwork_basic(cnName, subnetwork1Name, subnetwork2Name, subnetwork3Name),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSubnetworkExists(
|
testAccCheckComputeSubnetworkExists(
|
||||||
|
@ -73,12 +73,12 @@ func TestAccComputeSubnetwork_basic(t *testing.T) {
|
||||||
"google_compute_subnetwork.network-ref-by-name", &subnetwork2),
|
"google_compute_subnetwork.network-ref-by-name", &subnetwork2),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_subnetwork.network-ref-by-url",
|
ResourceName: "google_compute_subnetwork.network-ref-by-url",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_subnetwork.network-with-private-google-access",
|
ResourceName: "google_compute_subnetwork.network-with-private-google-access",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -100,14 +100,14 @@ func TestAccComputeSubnetwork_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSubnetworkDestroy,
|
CheckDestroy: testAccCheckComputeSubnetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSubnetwork_update1(cnName, "10.2.0.0/24", subnetworkName),
|
Config: testAccComputeSubnetwork_update1(cnName, "10.2.0.0/24", subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSubnetworkExists(
|
testAccCheckComputeSubnetworkExists(
|
||||||
"google_compute_subnetwork.network-with-private-google-access", &subnetwork),
|
"google_compute_subnetwork.network-with-private-google-access", &subnetwork),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
// Expand IP CIDR range and update private_ip_google_access
|
// Expand IP CIDR range and update private_ip_google_access
|
||||||
Config: testAccComputeSubnetwork_update2(cnName, "10.2.0.0/16", subnetworkName),
|
Config: testAccComputeSubnetwork_update2(cnName, "10.2.0.0/16", subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -115,7 +115,7 @@ func TestAccComputeSubnetwork_update(t *testing.T) {
|
||||||
"google_compute_subnetwork.network-with-private-google-access", &subnetwork),
|
"google_compute_subnetwork.network-with-private-google-access", &subnetwork),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
// Shrink IP CIDR range and update private_ip_google_access
|
// Shrink IP CIDR range and update private_ip_google_access
|
||||||
Config: testAccComputeSubnetwork_update2(cnName, "10.2.0.0/24", subnetworkName),
|
Config: testAccComputeSubnetwork_update2(cnName, "10.2.0.0/24", subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
|
@ -144,14 +144,14 @@ func TestAccComputeSubnetwork_secondaryIpRanges(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeSubnetworkDestroy,
|
CheckDestroy: testAccCheckComputeSubnetworkDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSubnetwork_secondaryIpRanges_update1(cnName, subnetworkName),
|
Config: testAccComputeSubnetwork_secondaryIpRanges_update1(cnName, subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSubnetworkExists("google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork),
|
testAccCheckComputeSubnetworkExists("google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork),
|
||||||
testAccCheckComputeSubnetworkHasSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update1", "192.168.10.0/24"),
|
testAccCheckComputeSubnetworkHasSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update1", "192.168.10.0/24"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSubnetwork_secondaryIpRanges_update2(cnName, subnetworkName),
|
Config: testAccComputeSubnetwork_secondaryIpRanges_update2(cnName, subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSubnetworkExists("google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork),
|
testAccCheckComputeSubnetworkExists("google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork),
|
||||||
|
@ -159,7 +159,7 @@ func TestAccComputeSubnetwork_secondaryIpRanges(t *testing.T) {
|
||||||
testAccCheckComputeSubnetworkHasSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update2", "192.168.11.0/24"),
|
testAccCheckComputeSubnetworkHasSecondaryIpRange(&subnetwork, "tf-test-secondary-range-update2", "192.168.11.0/24"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeSubnetwork_secondaryIpRanges_update1(cnName, subnetworkName),
|
Config: testAccComputeSubnetwork_secondaryIpRanges_update1(cnName, subnetworkName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeSubnetworkExists("google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork),
|
testAccCheckComputeSubnetworkExists("google_compute_subnetwork.network-with-private-secondary-ip-ranges", &subnetwork),
|
||||||
|
|
|
@ -23,14 +23,14 @@ func TestAccComputeTargetHttpProxy_basic(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeTargetHttpProxyDestroy,
|
CheckDestroy: testAccCheckComputeTargetHttpProxyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeTargetHttpProxy_basic1(target, backend, hc, urlmap1, urlmap2),
|
Config: testAccComputeTargetHttpProxy_basic1(target, backend, hc, urlmap1, urlmap2),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeTargetHttpProxyExists(
|
testAccCheckComputeTargetHttpProxyExists(
|
||||||
"google_compute_target_http_proxy.foobar"),
|
"google_compute_target_http_proxy.foobar"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
{
|
||||||
ResourceName: "google_compute_target_http_proxy.foobar",
|
ResourceName: "google_compute_target_http_proxy.foobar",
|
||||||
ImportState: true,
|
ImportState: true,
|
||||||
ImportStateVerify: true,
|
ImportStateVerify: true,
|
||||||
|
@ -53,7 +53,7 @@ func TestAccComputeTargetHttpProxy_update(t *testing.T) {
|
||||||
Providers: testAccProviders,
|
Providers: testAccProviders,
|
||||||
CheckDestroy: testAccCheckComputeTargetHttpProxyDestroy,
|
CheckDestroy: testAccCheckComputeTargetHttpProxyDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeTargetHttpProxy_basic1(target, backend, hc, urlmap1, urlmap2),
|
Config: testAccComputeTargetHttpProxy_basic1(target, backend, hc, urlmap1, urlmap2),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeTargetHttpProxyExists(
|
testAccCheckComputeTargetHttpProxyExists(
|
||||||
|
@ -61,7 +61,7 @@ func TestAccComputeTargetHttpProxy_update(t *testing.T) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
resource.TestStep{
|
{
|
||||||
Config: testAccComputeTargetHttpProxy_basic2(target, backend, hc, urlmap1, urlmap2),
|
Config: testAccComputeTargetHttpProxy_basic2(target, backend, hc, urlmap1, urlmap2),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeTargetHttpProxyExists(
|
testAccCheckComputeTargetHttpProxyExists(
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user