Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upgrade-0.12
Browse files Browse the repository at this point in the history
* upstream/master: (39 commits)
  Update CHANGELOG for hashicorp#8850
  tests/provider: Add tfproviderlint and enable S001-S005 checks
  service/kafka: Changes for General Availability Release
  chore(deps): update module hashicorp/terraform to v0.12.1
  deps: github.com/golangci/golangci-lint/cmd/golangci-lint@de1d1ad903cd
  Update CHANGELOG.md
  Update CHANGELOG for hashicorp#6322
  Retry timeout error for acmpca cert authority
  Add nil check for S3 bucket metric filter
  Update cloudwatch_event_target.html.markdown
  Update module aws/aws-sdk-go to v1.19.42
  Add a nil check for reading spot options
  Update waf_sql_injection_match_set.html.markdown
  Document the aws_ssm_activation "id" attribute
  aws_subnet: Increase timeout for delete to 20 mins
  Secure basic CloudTrail example
  docs/resource/aws_route53_record: Add NS and SOA Record Management example
  Update default example to use json instead of form
  tests/service/waf: Add PreCheck for service availability
  tests/service/transfer: Add PreCheck for service availability
  ...
  • Loading branch information
akatrevorjay committed Jun 6, 2019
2 parents ac20102 + 1e73a9d commit 122b8d5
Show file tree
Hide file tree
Showing 205 changed files with 14,018 additions and 3,652 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
## 2.14.0 (Unreleased)

ENHANCEMENTS:

* data-source/aws_msk_cluster: Add `bootstrap_brokers_tls` attribute
* resource/aws_msk_cluster: Add `client_authentication`, `configuration_info`, and `encryption_in_transit` configuration blocks [GH-8850]
* resource/aws_msk_cluster: Add `bootstrap_brokers_tls` and `current_version` attributes [GH-8850]
* resource/aws_msk_cluster: Support `broker_node_group_into` configuration block `ebs_volume_size` argument updates [GH-8850]
* resource/aws_msk_cluster: Support tagging on creation [GH-8850]
* resource/aws_subnet: Use customizable timeouts for pending creation and waiting for `DependencyViolation` errors on deletion [GH-6322]

BUG FIXES:

* resource/aws_subnet: Bump default timeout for deletion from 10 to 20 minutes to better handle ELBv2 ENI deletions [GH-6322]
* resource/aws_launch_template: Add a nil check for `spot_options` to avoiding panicking if options are empty [GH-8844]

## 2.13.0 (May 31, 2019)

FEATURES:
Expand Down
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ websitefmtcheck:
lint:
@echo "==> Checking source code against linters..."
@GOGC=30 golangci-lint run ./$(PKG_NAME)
@tfproviderlint -c 1 -S001 -S002 -S003 -S004 -S005 ./$(PKG_NAME)

tools:
GO111MODULE=on go install github.com/bflad/tfproviderlint/cmd/tfproviderlint
GO111MODULE=on go install github.com/client9/misspell/cmd/misspell
GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint

Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_batch_compute_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAccDataSourceAwsBatchComputeEnvironment(t *testing.T) {
datasourceName := "data.aws_batch_compute_environment.by_name"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_batch_job_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAccDataSourceAwsBatchJobQueue(t *testing.T) {
datasourceName := "data.aws_batch_job_queue.by_name"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_cognito_user_pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestAccDataSourceAwsCognitoUserPools_basic(t *testing.T) {
rName := fmt.Sprintf("tf_acc_ds_cognito_user_pools_%s", acctest.RandString(7))
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_eks_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAccAWSEksClusterDataSource_basic(t *testing.T) {
resourceName := "aws_eks_cluster.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEksClusterDestroy,
Steps: []resource.TestStep{
Expand Down
17 changes: 6 additions & 11 deletions aws/data_source_aws_msk_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func dataSourceAwsMskCluster() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"bootstrap_brokers_tls": {
Type: schema.TypeString,
Computed: true,
},
"cluster_name": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -92,23 +96,14 @@ func dataSourceAwsMskClusterRead(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("error reading MSK Cluster (%s) bootstrap brokers: %s", aws.StringValue(cluster.ClusterArn), err)
}

listTagsInput := &kafka.ListTagsForResourceInput{
ResourceArn: cluster.ClusterArn,
}

listTagsOutput, err := conn.ListTagsForResource(listTagsInput)

if err != nil {
return fmt.Errorf("error reading MSK Cluster (%s) tags: %s", aws.StringValue(cluster.ClusterArn), err)
}

d.Set("arn", aws.StringValue(cluster.ClusterArn))
d.Set("bootstrap_brokers", aws.StringValue(bootstrapBrokersoOutput.BootstrapBrokerString))
d.Set("bootstrap_brokers_tls", aws.StringValue(bootstrapBrokersoOutput.BootstrapBrokerStringTls))
d.Set("cluster_name", aws.StringValue(cluster.ClusterName))
d.Set("kafka_version", aws.StringValue(cluster.CurrentBrokerSoftwareInfo.KafkaVersion))
d.Set("number_of_broker_nodes", aws.Int64Value(cluster.NumberOfBrokerNodes))

if err := d.Set("tags", tagsToMapMskCluster(listTagsOutput.Tags)); err != nil {
if err := d.Set("tags", tagsToMapMskCluster(cluster.Tags)); err != nil {
return fmt.Errorf("error setting tags: %s", err)
}

Expand Down
1 change: 1 addition & 0 deletions aws/data_source_aws_msk_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestAccAWSMskClusterDataSource_Name(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceName, "arn"),
resource.TestCheckResourceAttrSet(dataSourceName, "bootstrap_brokers"),
resource.TestCheckResourceAttrSet(dataSourceName, "bootstrap_brokers_tls"),
resource.TestCheckResourceAttrPair(resourceName, "cluster_name", dataSourceName, "cluster_name"),
resource.TestCheckResourceAttrPair(resourceName, "kafka_version", dataSourceName, "kafka_version"),
resource.TestCheckResourceAttrPair(resourceName, "number_of_broker_nodes", dataSourceName, "number_of_broker_nodes"),
Expand Down
8 changes: 4 additions & 4 deletions aws/data_source_aws_secretsmanager_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func TestAccDataSourceAwsSecretsManagerSecret_Basic(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -37,7 +37,7 @@ func TestAccDataSourceAwsSecretsManagerSecret_ARN(t *testing.T) {
datasourceName := "data.aws_secretsmanager_secret.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -56,7 +56,7 @@ func TestAccDataSourceAwsSecretsManagerSecret_Name(t *testing.T) {
datasourceName := "data.aws_secretsmanager_secret.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -75,7 +75,7 @@ func TestAccDataSourceAwsSecretsManagerSecret_Policy(t *testing.T) {
datasourceName := "data.aws_secretsmanager_secret.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
6 changes: 3 additions & 3 deletions aws/data_source_aws_secretsmanager_secret_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestAccDataSourceAwsSecretsManagerSecretVersion_Basic(t *testing.T) {
datasourceName := "data.aws_secretsmanager_secret_version.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -39,7 +39,7 @@ func TestAccDataSourceAwsSecretsManagerSecretVersion_VersionID(t *testing.T) {
datasourceName := "data.aws_secretsmanager_secret_version.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -58,7 +58,7 @@ func TestAccDataSourceAwsSecretsManagerSecretVersion_VersionStage(t *testing.T)
datasourceName := "data.aws_secretsmanager_secret_version.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
6 changes: 3 additions & 3 deletions aws/data_source_aws_transfer_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccDataSourceAwsTransferServer_basic(t *testing.T) {
datasourceName := "data.aws_transfer_server.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -35,7 +35,7 @@ func TestAccDataSourceAwsTransferServer_service_managed(t *testing.T) {
datasourceName := "data.aws_transfer_server.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand All @@ -57,7 +57,7 @@ func TestAccDataSourceAwsTransferServer_apigateway(t *testing.T) {
datasourceName := "data.aws_transfer_server.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_acmpca_certificate_authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ func resourceAwsAcmpcaCertificateAuthorityCreate(d *schema.ResourceData, meta in
}
return nil
})
if isResourceTimeoutError(err) {
output, err = conn.CreateCertificateAuthority(input)
}
if err != nil {
return fmt.Errorf("error creating ACMPCA Certificate Authority: %s", err)
}
Expand Down
40 changes: 28 additions & 12 deletions aws/resource_aws_batch_compute_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestAccAWSBatchComputeEnvironment_createEc2(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -85,7 +85,7 @@ func TestAccAWSBatchComputeEnvironment_createEc2WithTags(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -105,7 +105,7 @@ func TestAccAWSBatchComputeEnvironment_createSpot(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -123,7 +123,7 @@ func TestAccAWSBatchComputeEnvironment_createUnmanaged(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -141,7 +141,7 @@ func TestAccAWSBatchComputeEnvironment_updateMaxvCpus(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -167,7 +167,7 @@ func TestAccAWSBatchComputeEnvironment_updateInstanceType(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName(t *testing.T
expectedUpdatedName := fmt.Sprintf("tf_acc_test_updated_%d", rInt)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -221,7 +221,7 @@ func TestAccAWSBatchComputeEnvironment_createEc2WithoutComputeResources(t *testi
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -237,7 +237,7 @@ func TestAccAWSBatchComputeEnvironment_createUnmanagedWithComputeResources(t *te
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -256,7 +256,7 @@ func TestAccAWSBatchComputeEnvironment_launchTemplate(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -280,7 +280,7 @@ func TestAccAWSBatchComputeEnvironment_createSpotWithoutBidPercentage(t *testing
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand All @@ -296,7 +296,7 @@ func TestAccAWSBatchComputeEnvironment_updateState(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -373,6 +373,22 @@ func testAccCheckAwsBatchComputeEnvironmentExists() resource.TestCheckFunc {
}
}

func testAccPreCheckAWSBatch(t *testing.T) {
conn := testAccProvider.Meta().(*AWSClient).batchconn

input := &batch.DescribeComputeEnvironmentsInput{}

_, err := conn.DescribeComputeEnvironments(input)

if testAccPreCheckSkipError(err) {
t.Skipf("skipping acceptance testing: %s", err)
}

if err != nil {
t.Fatalf("unexpected PreCheck error: %s", err)
}
}

func testAccAWSBatchComputeEnvironmentConfigBase(rInt int) string {
return fmt.Sprintf(`
########## ecs_instance_role ##########
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_batch_job_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestAccAWSBatchJobDefinition_basic(t *testing.T) {
ri := acctest.RandInt()
config := fmt.Sprintf(testAccBatchJobDefinitionBaseConfig, ri)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchJobDefinitionDestroy,
Steps: []resource.TestStep{
Expand All @@ -74,7 +74,7 @@ func TestAccAWSBatchJobDefinition_updateForcesNewResource(t *testing.T) {
config := fmt.Sprintf(testAccBatchJobDefinitionBaseConfig, ri)
updateConfig := fmt.Sprintf(testAccBatchJobDefinitionUpdateConfig, ri)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchJobDefinitionDestroy,
Steps: []resource.TestStep{
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_batch_job_queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestAccAWSBatchJobQueue_basic(t *testing.T) {
ri := acctest.RandInt()
config := fmt.Sprintf(testAccBatchJobQueueBasic, ri)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchJobQueueDestroy,
Steps: []resource.TestStep{
Expand All @@ -97,7 +97,7 @@ func TestAccAWSBatchJobQueue_disappears(t *testing.T) {
rInt := acctest.RandInt()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSLaunchTemplateDestroy,
Steps: []resource.TestStep{
Expand All @@ -119,7 +119,7 @@ func TestAccAWSBatchJobQueue_update(t *testing.T) {
config := fmt.Sprintf(testAccBatchJobQueueBasic, ri)
updateConfig := fmt.Sprintf(testAccBatchJobQueueUpdate, ri)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckBatchJobQueueDestroy,
Steps: []resource.TestStep{
Expand Down
Loading

0 comments on commit 122b8d5

Please sign in to comment.