Skip to content

Commit

Permalink
Merge branch 'master' into pr-2422
Browse files Browse the repository at this point in the history
* master: (147 commits)
  Cleaned Data Sources
  Update CHANGELOG.md
  resource/cognito_user_pool: Update Cognito email message length to 20,000 (#2692)
  Update ecs_service.html.markdown (#2694)
  Documentation: r/ecs_task_definition note about quote escaping container_definition (#2162)
  Cleanup after v1.6.0 release
  v1.6.0
  Make depends_on consistent with note (#2526)
  removing duplicate
  Update CHANGELOG.md
  r/aws_ssm_parameter: Fix arn attribute for full path names and improve testing
  Update CHANGELOG.md
  Update CHANGELOG.md
  s3: Add validation for SSE Algorithm and correct spelling
  #2217: fixed when encryption is AES256
  #2217: documentation
  #2217: re-enable default encryption after disabling in via UI
  #2217: wrote additional acceptance test
  #2217: wrote typical acceptance test
  #2217: make fmt
  ...
  • Loading branch information
catsby committed Dec 19, 2017
2 parents 84a1e38 + cf392ce commit 01ca386
Show file tree
Hide file tree
Showing 568 changed files with 150,652 additions and 30,428 deletions.
68 changes: 61 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,70 @@
## 1.3.2 (Unreleased)
## 1.6.1 (Unreleased)

BUG FIXES:

* Fix Cognito Userpool `email_subject_by_link` [GH-2395]
* resource/aws_api_gateway_method_response: Fix conflict exception in API gateway method response [GH-2393]
* resource/cognito_user_pool: Update Cognito email message length to 20,000 [GH-2692]

## 1.6.0 (December 18, 2017)

FEATURES:

* **New Data Source:** `aws_network_interface` ([#2316](https://github.com/terraform-providers/terraform-provider-aws/issues/2316))
* **New Data Source:** `aws_elb` ([#2004](https://github.com/terraform-providers/terraform-provider-aws/issues/2004))
* **New Resource:** `aws_dx_connection_association` ([#2360](https://github.com/terraform-providers/terraform-provider-aws/issues/2360))
* **New Resource:** `aws_appautoscaling_scheduled_action` ([#2231](https://github.com/terraform-providers/terraform-provider-aws/issues/2231))
* **New Resource:** `aws_cloudwatch_log_resource_policy` ([#2243](https://github.com/terraform-providers/terraform-provider-aws/issues/2243))
* **New Resource:** `aws_media_store_container` ([#2448](https://github.com/terraform-providers/terraform-provider-aws/issues/2448))
* **New Resource:** `aws_service_discovery_public_dns_namespace` ([#2569](https://github.com/terraform-providers/terraform-provider-aws/issues/2569))
* **New Resource:** `aws_service_discovery_private_dns_namespace` ([#2589](https://github.com/terraform-providers/terraform-provider-aws/issues/2589))

IMPROVEMENTS:

* resource/aws_ssm_association: Add `association_name` ([#2257](https://github.com/terraform-providers/terraform-provider-aws/issues/2257))
* resource/aws_ecs_service: Add `network_configuration` ([#2299](https://github.com/terraform-providers/terraform-provider-aws/issues/2299))
* resource/aws_lambda_function: Add `reserved_concurrent_executions` ([#2504](https://github.com/terraform-providers/terraform-provider-aws/issues/2504))
* resource/aws_ecs_service: Add `launch_type` (Fargate support) ([#2483](https://github.com/terraform-providers/terraform-provider-aws/issues/2483))
* resource/aws_ecs_task_definition: Add `cpu`, `memory`, `execution_role_arn` & `requires_compatibilities` (Fargate support) ([#2483](https://github.com/terraform-providers/terraform-provider-aws/issues/2483))
* resource/aws_ecs_cluster: Add arn attribute ([#2552](https://github.com/terraform-providers/terraform-provider-aws/issues/2552))
* resource/aws_elasticache_security_group: Add import support ([#2277](https://github.com/terraform-providers/terraform-provider-aws/issues/2277))
* resource/aws_sqs_queue_policy: Support import by queue URL ([#2544](https://github.com/terraform-providers/terraform-provider-aws/issues/2544))
* resource/aws_elasticsearch_domain: Add `log_publishing_options` ([#2285](https://github.com/terraform-providers/terraform-provider-aws/issues/2285))
* resource/aws_athena_database: Add `force_destroy` field ([#2363](https://github.com/terraform-providers/terraform-provider-aws/issues/2363))
* resource/aws_elasticache_replication_group: Add support for Redis auth, in-transit and at-rest encryption ([#2090](https://github.com/terraform-providers/terraform-provider-aws/issues/2090))
* resource/aws_s3_bucket: Add `server_side_encryption_configuration` block ([#2472](https://github.com/terraform-providers/terraform-provider-aws/issues/2472))

BUG FIXES:

* data-source/aws_instance: Set `placement_group` if available ([#2400](https://github.com/terraform-providers/terraform-provider-aws/issues/2400))
* resource/aws_elasticache_parameter_group: Add StateFunc to make name lowercase ([#2426](https://github.com/terraform-providers/terraform-provider-aws/issues/2426))
* resource/aws_elasticache_replication_group: Modify validation, make replication_group_id lowercase ([#2432](https://github.com/terraform-providers/terraform-provider-aws/issues/2432))
* resource/aws_db_instance: Treat `storage-optimization` as valid state ([#2409](https://github.com/terraform-providers/terraform-provider-aws/issues/2409))
* resource/aws_dynamodb_table: Ensure `ttl` is properly read ([#2452](https://github.com/terraform-providers/terraform-provider-aws/issues/2452))
* resource/aws_lb_target_group: fixes to behavior based on protocol type ([#2380](https://github.com/terraform-providers/terraform-provider-aws/issues/2380))
* resource/aws_mq_broker: Fix crash in hashing function ([#2598](https://github.com/terraform-providers/terraform-provider-aws/issues/2598))
* resource/aws_ebs_volume_attachment: Allow attachments to instances which are stopped ([#1444](https://github.com/terraform-providers/terraform-provider-aws/issues/1444))
* resource/aws_ssm_parameter: Path names with a leading '/' no longer generate incorrect ARNs ([#2604](https://github.com/terraform-providers/terraform-provider-aws/issues/2604))

## 1.5.0 (November 29, 2017)

FEATURES:

* **New Resource:** `aws_mq_broker` ([#2466](https://github.com/terraform-providers/terraform-provider-aws/issues/2466))
* **New Resource:** `aws_mq_configuration` ([#2466](https://github.com/terraform-providers/terraform-provider-aws/issues/2466))

## 1.4.0 (November 29, 2017)

BUG FIXES:

* resource/aws_cognito_user_pool: Fix `email_subject_by_link` ([#2395](https://github.com/terraform-providers/terraform-provider-aws/issues/2395))
* resource/aws_api_gateway_method_response: Fix conflict exception in API gateway method response ([#2393](https://github.com/terraform-providers/terraform-provider-aws/issues/2393))
* resource/aws_api_gateway_method: Fix typo `authorization_type` -> `authorization` ([#2430](https://github.com/terraform-providers/terraform-provider-aws/issues/2430))

IMPROVEMENTS:

* resource/aws_ssm_maintenance_window_target: Change MaxItems of targets [GH-2361]
* data-source/aws_nat_gateway: Add missing address attributes to the schema [GH-2209]
* resource/aws_sfn_state_machine: Support Update State machine call [GH-2349]
* resource/aws_instance: Set placement_group in state on read if available [GH-2398]
* data-source/aws_nat_gateway: Add missing address attributes to the schema ([#2209](https://github.com/terraform-providers/terraform-provider-aws/issues/2209))
* resource/aws_ssm_maintenance_window_target: Change MaxItems of targets ([#2361](https://github.com/terraform-providers/terraform-provider-aws/issues/2361))
* resource/aws_sfn_state_machine: Support Update State machine call ([#2349](https://github.com/terraform-providers/terraform-provider-aws/issues/2349))
* resource/aws_instance: Set placement_group in state on read if available ([#2398](https://github.com/terraform-providers/terraform-provider-aws/issues/2398))

## 1.3.1 (November 20, 2017)

Expand Down
7 changes: 6 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SWEEP?=us-east-1,us-west-2
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)

Expand All @@ -6,6 +7,10 @@ default: build
build: fmtcheck
go install

sweep:
@echo "WARNING: This will destroy infrastructure. Use only in development accounts."
go test $(TEST) -v -sweep=$(SWEEP) $(SWEEPARGS)

test: fmtcheck
go test -i $(TEST) || exit 1
echo $(TEST) | \
Expand Down Expand Up @@ -43,5 +48,5 @@ test-compile:
fi
go test -c $(TEST) $(TESTARGS)

.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile
.PHONY: build sweep test testacc vet fmt fmtcheck errcheck vendor-status test-compile

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ $ make build

Using the provider
----------------------
If you're building the provider, follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) to install it as a plugin. After placing it into your plugins directory, run `terraform init` to initialize it.
If you're building the provider, follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) After placing it into your plugins directory, run `terraform init` to initialize it.

Developing the Provider
---------------------------

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.8+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.9+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.

To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

Expand Down
9 changes: 9 additions & 0 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ import (
"github.com/aws/aws-sdk-go/service/kms"
"github.com/aws/aws-sdk-go/service/lambda"
"github.com/aws/aws-sdk-go/service/lightsail"
"github.com/aws/aws-sdk-go/service/mediastore"
"github.com/aws/aws-sdk-go/service/mq"
"github.com/aws/aws-sdk-go/service/opsworks"
"github.com/aws/aws-sdk-go/service/rds"
"github.com/aws/aws-sdk-go/service/redshift"
"github.com/aws/aws-sdk-go/service/route53"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/servicecatalog"
"github.com/aws/aws-sdk-go/service/servicediscovery"
"github.com/aws/aws-sdk-go/service/ses"
"github.com/aws/aws-sdk-go/service/sfn"
"github.com/aws/aws-sdk-go/service/simpledb"
Expand Down Expand Up @@ -172,12 +175,14 @@ type AWSClient struct {
elastictranscoderconn *elastictranscoder.ElasticTranscoder
lambdaconn *lambda.Lambda
lightsailconn *lightsail.Lightsail
mqconn *mq.MQ
opsworksconn *opsworks.OpsWorks
glacierconn *glacier.Glacier
codebuildconn *codebuild.CodeBuild
codedeployconn *codedeploy.CodeDeploy
codecommitconn *codecommit.CodeCommit
codepipelineconn *codepipeline.CodePipeline
sdconn *servicediscovery.ServiceDiscovery
sfnconn *sfn.SFN
ssmconn *ssm.SSM
wafconn *waf.WAF
Expand All @@ -186,6 +191,7 @@ type AWSClient struct {
batchconn *batch.Batch
athenaconn *athena.Athena
dxconn *directconnect.DirectConnect
mediastoreconn *mediastore.MediaStore
}

func (c *AWSClient) S3() *s3.S3 {
Expand Down Expand Up @@ -406,13 +412,15 @@ func (c *Config) Client() (interface{}, error) {
client.kmsconn = kms.New(awsKmsSess)
client.lambdaconn = lambda.New(sess)
client.lightsailconn = lightsail.New(sess)
client.mqconn = mq.New(sess)
client.opsworksconn = opsworks.New(sess)
client.r53conn = route53.New(r53Sess)
client.rdsconn = rds.New(awsRdsSess)
client.redshiftconn = redshift.New(sess)
client.simpledbconn = simpledb.New(sess)
client.s3conn = s3.New(awsS3Sess)
client.scconn = servicecatalog.New(sess)
client.sdconn = servicediscovery.New(sess)
client.sesConn = ses.New(sess)
client.sfnconn = sfn.New(sess)
client.snsconn = sns.New(awsSnsSess)
Expand All @@ -423,6 +431,7 @@ func (c *Config) Client() (interface{}, error) {
client.batchconn = batch.New(sess)
client.athenaconn = athena.New(sess)
client.dxconn = directconnect.New(sess)
client.mediastoreconn = mediastore.New(sess)

// Workaround for https://github.com/aws/aws-sdk-go/issues/1376
client.kinesisconn.Handlers.Retry.PushBack(func(r *request.Request) {
Expand Down
5 changes: 3 additions & 2 deletions aws/data_source_aws_acm_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aws

import (
"fmt"
"log"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -38,10 +39,9 @@ func dataSourceAwsAcmCertificate() *schema.Resource {

func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).acmconn
params := &acm.ListCertificatesInput{}

params := &acm.ListCertificatesInput{}
target := d.Get("domain")

statuses, ok := d.GetOk("statuses")
if ok {
statusStrings := statuses.([]interface{})
Expand All @@ -51,6 +51,7 @@ func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) e
}

var arns []string
log.Printf("[DEBUG] Reading ACM Certificate: %s", params)
err := conn.ListCertificatesPages(params, func(page *acm.ListCertificatesOutput, lastPage bool) bool {
for _, cert := range page.CertificateSummaryList {
if *cert.DomainName == target {
Expand Down
1 change: 1 addition & 0 deletions aws/data_source_aws_ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func dataSourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error {
}
}

log.Printf("[DEBUG] Reading AMI: %s", params)
resp, err := conn.DescribeImages(params)
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion aws/data_source_aws_ami_ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func dataSourceAwsAmiIds() *schema.Resource {
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
"ids": &schema.Schema{
"ids": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
Expand Down Expand Up @@ -71,6 +71,7 @@ func dataSourceAwsAmiIdsRead(d *schema.ResourceData, meta interface{}) error {
}
}

log.Printf("[DEBUG] Reading AMI IDs: %s", params)
resp, err := conn.DescribeImages(params)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions aws/data_source_aws_autoscaling_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func dataSourceAwsAutoscalingGroups() *schema.Resource {
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"values": &schema.Schema{
"values": {
Type: schema.TypeSet,
Required: true,
Elem: &schema.Schema{Type: schema.TypeString},
Expand Down
10 changes: 5 additions & 5 deletions aws/data_source_aws_availability_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ func dataSourceAwsAvailabilityZone() *schema.Resource {
Read: dataSourceAwsAvailabilityZoneRead,

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"region": &schema.Schema{
"region": {
Type: schema.TypeString,
Computed: true,
},

"name_suffix": &schema.Schema{
"name_suffix": {
Type: schema.TypeString,
Computed: true,
},

"state": &schema.Schema{
"state": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Expand Down Expand Up @@ -58,7 +58,7 @@ func dataSourceAwsAvailabilityZoneRead(d *schema.ResourceData, meta interface{})
req.Filters = nil
}

log.Printf("[DEBUG] DescribeAvailabilityZones %s\n", req)
log.Printf("[DEBUG] Reading Availability Zone: %s", req)
resp, err := conn.DescribeAvailabilityZones(req)
if err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions aws/data_source_aws_availability_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func dataSourceAwsAvailabilityZonesRead(d *schema.ResourceData, meta interface{}
}
}

log.Printf("[DEBUG] Availability Zones request options: %#v", *request)

log.Printf("[DEBUG] Reading Availability Zones: %s", request)
resp, err := conn.DescribeAvailabilityZones(request)
if err != nil {
return fmt.Errorf("Error fetching Availability Zones: %s", err)
Expand Down
1 change: 0 additions & 1 deletion aws/data_source_aws_billing_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func dataSourceAwsBillingServiceAccount() *schema.Resource {

func dataSourceAwsBillingServiceAccountRead(d *schema.ResourceData, meta interface{}) error {
d.SetId(billingAccountId)

d.Set("arn", fmt.Sprintf("arn:%s:iam::%s:root", meta.(*AWSClient).partition, billingAccountId))

return nil
Expand Down
3 changes: 3 additions & 0 deletions aws/data_source_aws_caller_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func dataSourceAwsCallerIdentity() *schema.Resource {
func dataSourceAwsCallerIdentityRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*AWSClient).stsconn

log.Printf("[DEBUG] Reading Caller Identity")
res, err := client.GetCallerIdentity(&sts.GetCallerIdentityInput{})

if err != nil {
return fmt.Errorf("Error getting Caller Identity: %v", err)
}
Expand All @@ -46,5 +48,6 @@ func dataSourceAwsCallerIdentityRead(d *schema.ResourceData, meta interface{}) e
d.Set("account_id", res.Account)
d.Set("arn", res.Arn)
d.Set("user_id", res.UserId)

return nil
}
2 changes: 1 addition & 1 deletion aws/data_source_aws_canonical_user_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func dataSourceAwsCanonicalUserId() *schema.Resource {
func dataSourceAwsCanonicalUserIdRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).s3conn

log.Printf("[DEBUG] Listing S3 buckets.")
log.Printf("[DEBUG] Reading S3 Buckets")

req := &s3.ListBucketsInput{}
resp, err := conn.ListBuckets(req)
Expand Down
6 changes: 4 additions & 2 deletions aws/data_source_aws_cloudformation_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package aws

import (
"fmt"
"log"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudformation"
Expand Down Expand Up @@ -73,11 +74,12 @@ func dataSourceAwsCloudFormationStack() *schema.Resource {
func dataSourceAwsCloudFormationStackRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).cfconn
name := d.Get("name").(string)
input := cloudformation.DescribeStacksInput{
input := &cloudformation.DescribeStacksInput{
StackName: aws.String(name),
}

out, err := conn.DescribeStacks(&input)
log.Printf("[DEBUG] Reading CloudFormation Stack: %s", input)
out, err := conn.DescribeStacks(input)
if err != nil {
return fmt.Errorf("Failed describing CloudFormation stack (%s): %s", name, err)
}
Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_cloudtrail_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func dataSourceAwsCloudTrailServiceAccount() *schema.Resource {
Read: dataSourceAwsCloudTrailServiceAccountRead,

Schema: map[string]*schema.Schema{
"region": &schema.Schema{
"region": {
Type: schema.TypeString,
Optional: true,
},
Expand Down
6 changes: 3 additions & 3 deletions aws/data_source_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ func dataSourceAwsDbInstance() *schema.Resource {
func dataSourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).rdsconn

opts := rds.DescribeDBInstancesInput{
opts := &rds.DescribeDBInstancesInput{
DBInstanceIdentifier: aws.String(d.Get("db_instance_identifier").(string)),
}

log.Printf("[DEBUG] DB Instance describe configuration: %#v", opts)
log.Printf("[DEBUG] Reading DB Instance: %s", opts)

resp, err := conn.DescribeDBInstances(&opts)
resp, err := conn.DescribeDBInstances(opts)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion aws/data_source_aws_db_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ resource "aws_db_instance" "bar" {
allocated_storage = 10
engine = "MySQL"
instance_class = "db.m1.small"
instance_class = "db.t2.micro"
name = "baz"
password = "barbarbarbar"
username = "foo"
Expand Down
1 change: 1 addition & 0 deletions aws/data_source_aws_db_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func dataSourceAwsDbSnapshotRead(d *schema.ResourceData, meta interface{}) error
params.DBSnapshotIdentifier = aws.String(snapshotIdentifier.(string))
}

log.Printf("[DEBUG] Reading DB Snapshot: %s", params)
resp, err := conn.DescribeDBSnapshots(params)
if err != nil {
return err
Expand Down
Loading

0 comments on commit 01ca386

Please sign in to comment.