Skip to content

Commit

Permalink
Merge pull request #6 from terraform-providers/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
DrFaust92 authored Oct 30, 2019
2 parents c0f6d5e + 7699f5e commit 07ddc49
Show file tree
Hide file tree
Showing 309 changed files with 12,747 additions and 5,126 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
## 2.34.0 (Unreleased)

ENHANCEMENTS:

* resource/aws_elasticache_replication_group: Add `kms_key_id` argument (support KMS encryption) [GH-10380]
* resource/aws_glue_job: Add `glue_version` argument [GH-10237]
* resource/aws_storagegateway_smb_file_share: Add `tags` argument [GH-10620]

BUG FIXES:

* resource/aws_backup_plan: Correctly handle changes to `recovery_point_tags` arguments [GH-10641]
* resource/aws_backup_plan: Prevent `diffs didn't match` errors with `rule` configuration blocks [GH-10641]
* resource/aws_cloudhsm_v2_cluster: Ensure multiple tag configurations are applied correctly [GH-10309]
* resource/aws_cloudhsm_v2_cluster: Perform drift detection with tags [GH-10309]
* resource/aws_dx_gateway_association: Fix backwards compatibility issue with missing `dx_gateway_association_id` attribute [GH-8776]
* resource/aws_s3_bucket: Bypass `MethodNotAllowed` errors for Object Lock Configuration on read (support AWS C2S) [GH-10657]

## 2.33.0 (October 17, 2019)

Expand Down
5 changes: 3 additions & 2 deletions aws/resource_aws_acm_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ func TestAccAWSAcmCertificate_tags(t *testing.T) {
})
}

//lintignore:AT002
func TestAccAWSAcmCertificate_imported_DomainName(t *testing.T) {
resourceName := "aws_acm_certificate.test"

Expand Down Expand Up @@ -558,8 +559,8 @@ func TestAccAWSAcmCertificate_imported_DomainName(t *testing.T) {
})
}

// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/7103
func TestAccAWSAcmCertificate_imported_IpAddress(t *testing.T) {
//lintignore:AT002
func TestAccAWSAcmCertificate_imported_IpAddress(t *testing.T) { // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/7103
resourceName := "aws_acm_certificate.test"

resource.ParallelTest(t, resource.TestCase{
Expand Down
39 changes: 12 additions & 27 deletions aws/resource_aws_api_gateway_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,13 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccAWSAPIGatewayAccount_importBasic(t *testing.T) {
resourceName := "aws_api_gateway_account.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSAPIGatewayAccountDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSAPIGatewayAccountConfig_empty,
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAWSAPIGatewayAccount_basic(t *testing.T) {
var conf apigateway.Account

rInt := acctest.RandInt()
firstName := fmt.Sprintf("tf_acc_api_gateway_cloudwatch_%d", rInt)
secondName := fmt.Sprintf("tf_acc_api_gateway_cloudwatch_modified_%d", rInt)

resourceName := "aws_api_gateway_account.test"
expectedRoleArn_first := regexp.MustCompile(":role/" + firstName + "$")
expectedRoleArn_second := regexp.MustCompile(":role/" + secondName + "$")

Expand All @@ -50,23 +29,29 @@ func TestAccAWSAPIGatewayAccount_basic(t *testing.T) {
{
Config: testAccAWSAPIGatewayAccountConfig_updated(firstName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayAccountExists("aws_api_gateway_account.test", &conf),
testAccCheckAWSAPIGatewayAccountExists(resourceName, &conf),
testAccCheckAWSAPIGatewayAccountCloudwatchRoleArn(&conf, expectedRoleArn_first),
resource.TestMatchResourceAttr("aws_api_gateway_account.test", "cloudwatch_role_arn", expectedRoleArn_first),
resource.TestMatchResourceAttr(resourceName, "cloudwatch_role_arn", expectedRoleArn_first),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"cloudwatch_role_arn"},
},
{
Config: testAccAWSAPIGatewayAccountConfig_updated2(secondName),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayAccountExists("aws_api_gateway_account.test", &conf),
testAccCheckAWSAPIGatewayAccountExists(resourceName, &conf),
testAccCheckAWSAPIGatewayAccountCloudwatchRoleArn(&conf, expectedRoleArn_second),
resource.TestMatchResourceAttr("aws_api_gateway_account.test", "cloudwatch_role_arn", expectedRoleArn_second),
resource.TestMatchResourceAttr(resourceName, "cloudwatch_role_arn", expectedRoleArn_second),
),
},
{
Config: testAccAWSAPIGatewayAccountConfig_empty,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayAccountExists("aws_api_gateway_account.test", &conf),
testAccCheckAWSAPIGatewayAccountExists(resourceName, &conf),
testAccCheckAWSAPIGatewayAccountCloudwatchRoleArn(&conf, expectedRoleArn_second),
),
},
Expand Down
39 changes: 12 additions & 27 deletions aws/resource_aws_api_gateway_client_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func TestAccAWSAPIGatewayClientCertificate_basic(t *testing.T) {
var conf apigateway.ClientCertificate
resourceName := "aws_api_gateway_client_certificate.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -22,38 +23,22 @@ func TestAccAWSAPIGatewayClientCertificate_basic(t *testing.T) {
{
Config: testAccAWSAPIGatewayClientCertificateConfig_basic,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayClientCertificateExists("aws_api_gateway_client_certificate.cow", &conf),
resource.TestCheckResourceAttr("aws_api_gateway_client_certificate.cow", "description", "Hello from TF acceptance test"),
testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf),
resource.TestCheckResourceAttr(resourceName, "description", "Hello from TF acceptance test"),
),
},
{
Config: testAccAWSAPIGatewayClientCertificateConfig_basic_updated,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayClientCertificateExists("aws_api_gateway_client_certificate.cow", &conf),
resource.TestCheckResourceAttr("aws_api_gateway_client_certificate.cow", "description", "Hello from TF acceptance test - updated"),
),
},
},
})
}

func TestAccAWSAPIGatewayClientCertificate_importBasic(t *testing.T) {
resourceName := "aws_api_gateway_client_certificate.cow"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSAPIGatewayClientCertificateDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSAPIGatewayClientCertificateConfig_basic,
},

{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccAWSAPIGatewayClientCertificateConfig_basic_updated,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf),
resource.TestCheckResourceAttr(resourceName, "description", "Hello from TF acceptance test - updated"),
),
},
},
})
}
Expand Down Expand Up @@ -116,13 +101,13 @@ func testAccCheckAWSAPIGatewayClientCertificateDestroy(s *terraform.State) error
}

const testAccAWSAPIGatewayClientCertificateConfig_basic = `
resource "aws_api_gateway_client_certificate" "cow" {
resource "aws_api_gateway_client_certificate" "test" {
description = "Hello from TF acceptance test"
}
`

const testAccAWSAPIGatewayClientCertificateConfig_basic_updated = `
resource "aws_api_gateway_client_certificate" "cow" {
resource "aws_api_gateway_client_certificate" "test" {
description = "Hello from TF acceptance test - updated"
}
`
48 changes: 15 additions & 33 deletions aws/resource_aws_api_gateway_documentation_part_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ func TestAccAWSAPIGatewayDocumentationPart_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccAWSAPIGatewayDocumentationPartConfig(apiName, strconv.Quote(uProperties)),
Check: resource.ComposeTestCheckFunc(
Expand Down Expand Up @@ -78,6 +83,11 @@ func TestAccAWSAPIGatewayDocumentationPart_method(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccAWSAPIGatewayDocumentationPartMethodConfig(apiName, strconv.Quote(uProperties)),
Check: resource.ComposeTestCheckFunc(
Expand Down Expand Up @@ -123,6 +133,11 @@ func TestAccAWSAPIGatewayDocumentationPart_responseHeader(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccAWSAPIGatewayDocumentationPartResponseHeaderConfig(apiName, strconv.Quote(uProperties)),
Check: resource.ComposeTestCheckFunc(
Expand All @@ -141,39 +156,6 @@ func TestAccAWSAPIGatewayDocumentationPart_responseHeader(t *testing.T) {
})
}

func TestAccAWSAPIGatewayDocumentationPart_importBasic(t *testing.T) {
var conf apigateway.DocumentationPart

rString := acctest.RandString(8)
apiName := fmt.Sprintf("tf_acc_api_doc_part_import_%s", rString)
properties := `{"description":"Terraform Acceptance Test"}`

resourceName := "aws_api_gateway_documentation_part.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSAPIGatewayDocumentationPartDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSAPIGatewayDocumentationPartConfig(apiName, strconv.Quote(properties)),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSAPIGatewayDocumentationPartExists(resourceName, &conf),
resource.TestCheckResourceAttr(resourceName, "location.#", "1"),
resource.TestCheckResourceAttr(resourceName, "location.0.type", "API"),
resource.TestCheckResourceAttr(resourceName, "properties", properties),
resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccCheckAWSAPIGatewayDocumentationPartExists(n string, res *apigateway.DocumentationPart) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
Expand Down
60 changes: 10 additions & 50 deletions aws/resource_aws_api_gateway_documentation_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func TestAccAWSAPIGatewayDocumentationVersion_basic(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down Expand Up @@ -63,6 +68,11 @@ func TestAccAWSAPIGatewayDocumentationVersion_allFields(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccAWSAPIGatewayDocumentationVersionAllFieldsConfig(version, apiName, stageName, uDescription),
Check: resource.ComposeTestCheckFunc(
Expand All @@ -76,56 +86,6 @@ func TestAccAWSAPIGatewayDocumentationVersion_allFields(t *testing.T) {
})
}

func TestAccAWSAPIGatewayDocumentationVersion_importBasic(t *testing.T) {
rString := acctest.RandString(8)
version := fmt.Sprintf("tf_acc_version_import_%s", rString)
apiName := fmt.Sprintf("tf_acc_api_doc_version_import_%s", rString)

resourceName := "aws_api_gateway_documentation_version.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSAPIGatewayDocumentationVersionBasicConfig(version, apiName),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAWSAPIGatewayDocumentationVersion_importAllFields(t *testing.T) {
rString := acctest.RandString(8)
version := fmt.Sprintf("tf_acc_version_import_af_%s", rString)
apiName := fmt.Sprintf("tf_acc_api_doc_version_import_af_%s", rString)
stageName := fmt.Sprintf("tf_acc_stage_%s", rString)
description := fmt.Sprintf("Tf Acc Test description %s", rString)

resourceName := "aws_api_gateway_documentation_version.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy,
Steps: []resource.TestStep{
{
Config: testAccAWSAPIGatewayDocumentationVersionAllFieldsConfig(version, apiName, stageName, description),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccCheckAWSAPIGatewayDocumentationVersionExists(n string, res *apigateway.DocumentationVersion) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
Expand Down
Loading

0 comments on commit 07ddc49

Please sign in to comment.