Commit Graph

3254 Commits

Author SHA1 Message Date
Anshul Sharma e1919edbb3 Allow underscore in database_name [redshift] (#10019)
* allow underscore in database_name [redshift]

Fixes #10009

* Added Test Cases To Validate Redshift DBName

* Remove Old Test Cases Regarding Redshift DBName Validation

* Added More Test Cases For Redshift DBName
2016-11-11 11:59:00 +02:00
clint shryock 303b07e61f provider/aws: Update AutoScaling Schedule test files to avoid conflicts 2016-11-10 11:36:57 -06:00
stack72 e02960810d
provider/aws: Rename zone_id to hosted_zone_id in aws_db_instance
Also added a test to prove that the computed value gets set

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBInstance_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/10 06:26:22 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBInstance_basic -timeout 120m
=== RUN   TestAccAWSDBInstance_basic
--- PASS: TestAccAWSDBInstance_basic (634.33s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws634.347s
```
2016-11-10 06:41:43 +00:00
Michel Rasschaert 62ea843ff3 zone_id exported attribute for db_instance resource 2016-11-09 19:54:09 +01:00
Paul Stack 643d42c412 provider/aws: AWS IAM, User and Role allow + in the name (#9991)
Fixes #9985

```
% make testacc TEST=./builtin/providers/aws
% TESTARGS='-run=TestValidateIamUserName'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/09 12:12:42 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestValidateIamUserName
-timeout 120m
=== RUN   TestValidateIamUserName
--- PASS: TestValidateIamUserName (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws0.026s
```
2016-11-09 15:54:15 +00:00
Paul Stack d66359b046 provider/aws: Fix panic when passing statuses to aws_acm_certificate (#9990)
Fixes #9989

When passing a list of statuses to the acm_certificate data source, we
were trying to cast a schema.TypeList directly to []string

We need to do it via an []interface{} and then cast to string when
ranging over the results. Without this, we get a panic
2016-11-09 15:53:36 +00:00
Nick Santamaria 8949419bef provider/aws: Add key_name_prefix argument to aws_key_pair resource (#9993)
* Added key_name_prefix to aws_key_pair resource schema.

* Added logic to prefix the aws_key_pair name on create.

* Added aws_key_pair test config for key_name_prefix case.

* Copied test cases from testAccAWSSecurityGroup namespace.

* Modified copied test case to suit aws_key_pair resource.

* Changed required flag to optional on key_name argument for aws_key_pair resource.

* Added documentation for key_name_prefix argument.

* Code style fix.

* Fixed undefined variable error in test.
2016-11-09 15:35:51 +00:00
ddcprg 27527ef3cb EMR Cluster - core_instance_count doesn't actually refer to core instances 2016-11-09 08:47:23 -06:00
jmasseo 77ca7001a8 removing toLower from flattenElastiCacheParameters - aws_elasticache_parameter_group parameters can be case sensitive (#9820) 2016-11-09 11:34:00 +00:00
Paddy 78f8fea1fa Merge pull request #9950 from optimisticanshul/9928-aws-redshift-enhanced-vpc-routing
Added AWS Redshift Enhanced VPC Routing
2016-11-08 11:02:37 -08:00
Clint 81e599e53f Merge pull request #9600 from HotelsDotCom/master
AWS EMR resource - Support for Service Access Security Group
2016-11-08 11:36:03 -06:00
Anshul Sharma e9821eaced Updated Redshift Documentation and Added Test Cases for Redshift Enchaned VPC routing 2016-11-08 18:13:10 +05:30
Anshul Sharma 1030cc1344 Added AWS Redshift Enhanced VPC Routing 2016-11-08 17:36:29 +05:30
Paul Stack 38cd7947b6 provider/aws: Fix the validateFunc of aws_elasticache_replication_group (#9918)
Fixes #9895

The replication_group_id should allow length to be max of 20 not 16

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestResourceAWSElastiCacheReplicationGroupIdValidation'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/07 16:17:52 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestResourceAWSElastiCacheReplicationGroupIdValidation -timeout
120m
=== RUN   TestResourceAWSElastiCacheReplicationGroupIdValidation
--- PASS: TestResourceAWSElastiCacheReplicationGroupIdValidation (0.00s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws0.032s
```
2016-11-07 21:02:00 +00:00
Paul Stack c0442ee63f provider/aws: aws_alb_target_group arn_suffix missing the targetgroup (#9911)
The work to add the arn_suffix in #9734 skipped adding the targetgroup/
part of the arn

This PR adds it

//cc @firthh

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBTargetGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/07 12:19:16 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALBTargetGroup_ -timeout 120m
=== RUN   TestAccAWSALBTargetGroup_basic
--- PASS: TestAccAWSALBTargetGroup_basic (47.23s)
=== RUN   TestAccAWSALBTargetGroup_changeNameForceNew
--- PASS: TestAccAWSALBTargetGroup_changeNameForceNew (80.09s)
=== RUN   TestAccAWSALBTargetGroup_changeProtocolForceNew
--- PASS: TestAccAWSALBTargetGroup_changeProtocolForceNew (87.45s)
=== RUN   TestAccAWSALBTargetGroup_changePortForceNew
--- PASS: TestAccAWSALBTargetGroup_changePortForceNew (78.47s)
=== RUN   TestAccAWSALBTargetGroup_changeVpcForceNew
--- PASS: TestAccAWSALBTargetGroup_changeVpcForceNew (73.53s)
=== RUN   TestAccAWSALBTargetGroup_tags
--- PASS: TestAccAWSALBTargetGroup_tags (75.60s)
=== RUN   TestAccAWSALBTargetGroup_updateHealthCheck
--- PASS: TestAccAWSALBTargetGroup_updateHealthCheck (76.40s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	518.777s
```
2016-11-07 20:17:43 +00:00
Paul Stack 3f032ff611 provider/aws: Setting static_routes_only on import of vpn_connection (#9802)
fixes #9110

An error was found where, static_routes_only was not set on a vpn
connection import. This commit introduces setting the static_routes_only
to false when no Options are found. This follows the AWS convention as follows:

```
- options (structure)

Indicates whether the VPN connection requires static routes. If you are creating a VPN connection for a device that does not support BGP, you must specify true .
Default: false

```

So we take it that `static_options_only` is false by default

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpnConnection_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/02 10:38:18 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpnConnection_ -timeout 120m
=== RUN   TestAccAWSVpnConnection_importBasic
--- PASS: TestAccAWSVpnConnection_importBasic (178.29s)
=== RUN   TestAccAWSVpnConnection_basic
--- PASS: TestAccAWSVpnConnection_basic (336.81s)
=== RUN   TestAccAWSVpnConnection_withoutStaticRoutes
--- PASS: TestAccAWSVpnConnection_withoutStaticRoutes (195.45s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	710.572s
```
2016-11-07 16:12:41 +00:00
Masayuki Morita f68d5e82f3 provider/aws: Fix bug #9863 destroying aws_iam_user with force_destroy does not work (#9900) 2016-11-07 10:37:32 +00:00
Paddy a15726d069 Merge pull request #9857 from hashicorp/paddy_8822_fix_spot_fleet_ebs
provider/aws: Fix hashing of EBS volumes in spot fleet requests to prevent panics
2016-11-04 09:38:38 -07:00
Mitchell Hashimoto 125b7f4d44 Merge pull request #9806 from hashicorp/f-modify-aws-user-agent
provider/aws: Modify AWS User-Agent to new format
2016-11-04 08:50:15 -07:00
Clint abcc766344 Merge pull request #9871 from hashicorp/b-aws-opsworks-tests
provider/aws: Decouple and randomize OpsWorks test configs
2016-11-04 09:40:48 -05:00
clint shryock 639a088897 provider/aws: Decouple and randomize OpsWorks test configs 2016-11-04 09:33:07 -05:00
James Nugent 3361047e38 provider/aws: Address acm_certificate review items 2016-11-03 20:01:46 -04:00
Paul Hinze ccd745c96f provider/aws: New Data Source: aws_acm_certificate
Use this data source to get the ARN of a certificate in AWS Certificate
Manager (ACM). The process of requesting and verifying a certificate in ACM
requires some manual steps, which means that Terraform cannot automate the
creation of ACM certificates. But using this data source, you can reference
them by domain without having to hard code the ARNs as input.

The acceptance test included requires an ACM certificate be pre-created
in and information about it passed in via environment variables. It's a
bit sad but there's really no other way to do it.
2016-11-03 19:34:19 -04:00
Paddy 7d06ea8449 Fix EBS block device hashing in spot fleet requests.
When computing the set key for an EBS block device, we were using
the wrong function; we had hashEphemeralBlockDevice instead of
hashEbsBlockDevice. This caused a panic by trying to access the
virtual_name attribute that will never be set for EBS block
devices.

To fix this, I switched to the hashEbsBlockDevice function, which
is already being used to compute a Set key in the Schema. But in
the default case, where the snapshot_id attribute isn't specified,
this also caused a panic. I updated the way the string to hash is
generated to check for the existence of the device_name and
snapshot_id attributes before we use them, to avoid panics when
these optional attributes aren't set.
2016-11-03 16:24:19 -07:00
Paddy 24dd4273c7 Add an acceptance test for adding EBS volumes to a spot fleet req
Spot fleet requests can have EBS volumes attached to them, and at
the moment we're getting reports that crashes can be experienced
with them. This adds an acceptance test that exercises creating
a Spot Fleet request that has a non-instance EBS volume attached.
This successfully reproduces the panic.
2016-11-03 16:19:50 -07:00
Justin Nauman 9e11b59814 provider/aws: aws_autoscaling_attachment resource (#9146)
* GH-8755 - Adding in support to attach ASG to ELB as independent action

* GH-8755 - Adding in docs

* GH-8755 - Adjusting attribute name and responding to other PR feedback
2016-11-03 13:08:49 +00:00
James Nugent 549993147f Merge pull request #9822 from hashicorp/paddy_8502_sni
provider/aws: Add the enable_sni attribute for Route53 health checks.
2016-11-02 23:38:01 -04:00
Paddy 42049e984f provider/aws: Add the enable_sni attribute for Route53 health checks.
In #8502 it was requested that we add support for the EnableSNI
parameter of Route53's health checks; this enables customers to
manually specify whether or not the health check will use SNI when
communicating with the endpoint.

The customer originally requested we default to `false`. While
implementing the issue, I discovered that when creating health
checks with a Type set to HTTP, Amazon's default value for EnableSNI
is `false`. However, when creating health checks with a Type set to
HTTPS, Amazon's default value is `true`. So rather than setting a
default value, I made the attribute computed.
2016-11-02 16:23:35 -07:00
clint shryock d120e1a38a provider/aws: Fix TestAccAWSAPIGatewayDomainName_basic test 2016-11-02 16:23:39 -05:00
Paul Stack c5bd727f03 provider/aws: Allows aws_alb security_groups to be updated (#9804)
Fixes #9658
Fixes #8728

Originally, this would ForceNew as follows:

```
-/+ aws_alb.alb_test
    arn:                        "arn:aws:elasticloadbalancing:us-west-2:187416307283:loadbalancer/app/test-alb-9658/3459cd2446b76901" => "<computed>"
    arn_suffix:                 "app/test-alb-9658/3459cd2446b76901" => "<computed>"
    dns_name:                   "test-alb-9658-1463108301.us-west-2.elb.amazonaws.com" => "<computed>"
    enable_deletion_protection: "false" => "false"
    idle_timeout:               "30" => "30"
    internal:                   "false" => "false"
    name:                       "test-alb-9658" => "test-alb-9658"
    security_groups.#:          "2" => "1" (forces new resource)
    security_groups.1631253634: "sg-3256274b" => "" (forces new resource)
    security_groups.3505955000: "sg-1e572667" => "sg-1e572667" (forces new resource)
    subnets.#:                  "2" => "2"
    subnets.2407170741:         "subnet-ee536498" => "subnet-ee536498"
    subnets.2414619308:         "subnet-f1a7b595" => "subnet-f1a7b595"
    tags.%:                     "1" => "1"
    tags.TestName:              "TestAccAWSALB_basic" => "TestAccAWSALB_basic"
    vpc_id:                     "vpc-dd0ff9ba" => "<computed>"
    zone_id:                    "Z1H1FL5HABSF5" => "<computed>"

Plan: 1 to add, 0 to change, 1 to destroy.
```

When the ALB was ForceNew, the ARN changed. The test has been updated to include a check to make sure that the ARNs are the same after the update

After this change, it looks as follows:

```
~ aws_alb.alb_test
    security_groups.#:          "1" => "2"
    security_groups.1631253634: "" => "sg-3256274b"
    security_groups.3505955000: "sg-1e572667" => "sg-1e572667"

Plan: 0 to add, 1 to change, 0 to destroy.
```

Test Results:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALB_'                                                                                                                                ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/02 12:20:58 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALB_ -timeout 120m
=== RUN   TestAccAWSALB_basic
--- PASS: TestAccAWSALB_basic (64.25s)
=== RUN   TestAccAWSALB_generatedName
--- PASS: TestAccAWSALB_generatedName (65.04s)
=== RUN   TestAccAWSALB_namePrefix
--- PASS: TestAccAWSALB_namePrefix (67.02s)
=== RUN   TestAccAWSALB_tags
--- PASS: TestAccAWSALB_tags (96.06s)
=== RUN   TestAccAWSALB_updatedSecurityGroups
--- PASS: TestAccAWSALB_updatedSecurityGroups (101.61s)
=== RUN   TestAccAWSALB_noSecurityGroup
--- PASS: TestAccAWSALB_noSecurityGroup (59.83s)
=== RUN   TestAccAWSALB_accesslogs
--- PASS: TestAccAWSALB_accesslogs (162.65s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	616.489s
```
2016-11-02 16:11:12 +00:00
clint shryock 5cd40bce30 provider/aws: Modify AWS User-Agent to new format 2016-11-02 10:43:35 -05:00
Paul Stack 6649b938da provider/aws: Provide the option to skip_destroy on aws_volume_attachment (#9792)
* provider/aws: Provide the option to skip_destroy on
aws_volume_attachment

When you want to attach and detach pre-existing EBS volumes to an
instance, we would do that as follows:

```
resource "aws_instance" "web" {
	ami = "ami-21f78e11"
  availability_zone = "us-west-2a"
	instance_type = "t1.micro"
	tags {
		Name = "HelloWorld"
	}
}

data "aws_ebs_volume" "ebs_volume" {
  filter {
  	name = "size"
  	values = ["${aws_ebs_volume.example.size}"]
  }
  filter {
  	name = "availability-zone"
  	values = ["${aws_ebs_volume.example.availability_zone}"]
  }
  filter {
  	name = "tag:Name"
  	values = ["TestVolume"]
  }
}

resource "aws_volume_attachment" "ebs_att" {
  device_name = "/dev/sdh"
	volume_id = "${data.aws_ebs_volume.ebs_volume.id}"
	instance_id = "${aws_instance.web.id}"
	skip_destroy = true
}
```

The issue here is that when we run a terraform destroy command, the volume tries to get detached from a running instance and goes into a non-responsive state. We would have to force_destroy the volume at that point and risk losing any data on it.

This PR introduces the idea of `skip_destroy` on a volume attachment. tl;dr:

We want the volume to be detached from the instane when the instance itself has been destroyed. This way the normal shut procedures will happen and protect the disk for attachment to another instance

Volume Attachment Tests:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVolumeAttachment_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/02 00:47:27 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVolumeAttachment_ -timeout 120m
=== RUN   TestAccAWSVolumeAttachment_basic
--- PASS: TestAccAWSVolumeAttachment_basic (133.49s)
=== RUN   TestAccAWSVolumeAttachment_skipDestroy
--- PASS: TestAccAWSVolumeAttachment_skipDestroy (119.64s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	253.158s
```

EBS Volume Tests:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEBSVolume_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/02 01:00:18 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSEBSVolume_ -timeout 120m
=== RUN   TestAccAWSEBSVolume_importBasic
--- PASS: TestAccAWSEBSVolume_importBasic (26.38s)
=== RUN   TestAccAWSEBSVolume_basic
--- PASS: TestAccAWSEBSVolume_basic (26.86s)
=== RUN   TestAccAWSEBSVolume_NoIops
--- PASS: TestAccAWSEBSVolume_NoIops (27.89s)
=== RUN   TestAccAWSEBSVolume_withTags
--- PASS: TestAccAWSEBSVolume_withTags (26.88s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	108.032s
```

* Update volume_attachment.html.markdown
2016-11-02 15:29:37 +00:00
Martin Atkins 145bf42806 provider/aws: IAM policy document: normalize wildcard principals
There are three equivalent forms for expressing "everyone" (including
anonymous) in IAM policies:

- "Principals": "*"
- "Principals": {"AWS": "*"}
- "Principals": {"*": "*"}

The more-constrained syntax used by our aws_iam_policy_document data
source means that the user can only express the latter two of these
directly. However, when returning IAM policies from the API AWS likes to
normalize to the first form, causing unresolvable diffs.

This fixes #9335 by handling the "everyone" case as a special case,
serializing it in JSON as the "*" shorthand form.

This change does *not* address the normalization of hand-written policies
containing such elements. A similar change would need to be made in
the external package github.com/jen20/awspolicyequivalence in order to
avoid the issue for hand-written policies.
2016-11-01 08:46:34 -07:00
Paul Stack aaece37ec9 provider/aws: Adding a datasource for aws_ebs_volume (#9753)
This will allows us to filter a specific ebs_volume for attachment to an
aws_instance

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEbsVolumeDataSource_'✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/01 12:39:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEbsVolumeDataSource_ -timeout 120m
=== RUN   TestAccAWSEbsVolumeDataSource_basic
--- PASS: TestAccAWSEbsVolumeDataSource_basic (28.74s)
=== RUN   TestAccAWSEbsVolumeDataSource_multipleFilters
--- PASS: TestAccAWSEbsVolumeDataSource_multipleFilters (28.37s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws57.145s
```
2016-11-01 14:15:31 +00:00
Krzysztof Wilczynski 6f02a2df55 provider/aws: Allow `active` state while waiting for the VPC Peering Connection. (#9754)
* Allow `active` state while waiting for the VPC Peering Connection.

This commit adds `active` as one of the valid states in which the VPC Peering
Connection can be when it being created.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>

* Add more valid states.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-11-01 09:51:46 +00:00
Paul Stack 98c385723c provider/aws: Fix aws_route53_record alias perpetual diff (#9704)
Fixes #9628
Fixes #9298

When a route53_record alias is updated in the console, AWS prepends
`dualstack.` to the name. This is there incase IPV6 is wanted. It is
exactly the same without it as it is with it

In order to stop perpetual diffs, I introduced a normalizeFunc that will
that tke alias name and strip known issues:

* dualstack
* trailing dot

This normalize fun will continue to grow I'm sure

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRoute53Record_'                                         ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/29 00:28:12 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRoute53Record_ -timeout 120m
=== RUN   TestAccAWSRoute53Record_basic
--- PASS: TestAccAWSRoute53Record_basic (124.64s)
=== RUN   TestAccAWSRoute53Record_basic_fqdn
--- PASS: TestAccAWSRoute53Record_basic_fqdn (132.07s)
=== RUN   TestAccAWSRoute53Record_txtSupport
--- PASS: TestAccAWSRoute53Record_txtSupport (134.07s)
=== RUN   TestAccAWSRoute53Record_spfSupport
--- PASS: TestAccAWSRoute53Record_spfSupport (113.36s)
=== RUN   TestAccAWSRoute53Record_generatesSuffix
--- PASS: TestAccAWSRoute53Record_generatesSuffix (112.62s)
=== RUN   TestAccAWSRoute53Record_wildcard
--- PASS: TestAccAWSRoute53Record_wildcard (162.84s)
=== RUN   TestAccAWSRoute53Record_failover
--- PASS: TestAccAWSRoute53Record_failover (126.18s)
=== RUN   TestAccAWSRoute53Record_weighted_basic
--- PASS: TestAccAWSRoute53Record_weighted_basic (121.10s)
=== RUN   TestAccAWSRoute53Record_alias
--- PASS: TestAccAWSRoute53Record_alias (118.14s)
=== RUN   TestAccAWSRoute53Record_s3_alias
--- PASS: TestAccAWSRoute53Record_s3_alias (155.07s)
=== RUN   TestAccAWSRoute53Record_weighted_alias
--- PASS: TestAccAWSRoute53Record_weighted_alias (235.41s)
=== RUN   TestAccAWSRoute53Record_geolocation_basic
^[[C--- PASS: TestAccAWSRoute53Record_geolocation_basic (125.32s)
=== RUN   TestAccAWSRoute53Record_latency_basic
--- PASS: TestAccAWSRoute53Record_latency_basic (122.23s)
=== RUN   TestAccAWSRoute53Record_TypeChange
--- PASS: TestAccAWSRoute53Record_TypeChange (231.98s)
=== RUN   TestAccAWSRoute53Record_empty
--- PASS: TestAccAWSRoute53Record_empty (116.48s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	2131.526s
```

Before this fix, I was getting the following by recreating the code in

```
~ aws_route53_record.alias
    alias.1563903989.evaluate_target_health: "true" => "false"
    alias.1563903989.name:                   "9828-recreation-106795730.us-west-2.elb.amazonaws.com." => ""
    alias.1563903989.zone_id:                "Z1H1FL5HABSF5" => ""
    alias.318754017.evaluate_target_health:  "" => "true"
    alias.318754017.name:                    "" => "9828-recreation-106795730.us-west-2.elb.amazonaws.com"
    alias.318754017.zone_id:                 "" => "Z1H1FL5HABSF5"

Plan: 0 to add, 1 to change, 0 to destroy.
```

After this fix:

```

No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.
2016-10-31 19:18:00 +00:00
Anshul Sharma 6432bb546c Added AWS Resource WAF SqlInjectionMatchSet (#9709) 2016-10-31 17:51:47 +00:00
Paul Stack fdabf59380 provider/aws: Expose ARN suffix on ALB Target Group (#9734)
When creating a CloudWatch Metric for an Application Load Balancer Target Group  it is
neccessary to use the suffix of the ARN as the reference to the load
balancer TG . This commit exposes that as an attribute on the `aws_alb_target_group`
resource to prevent the need to use regular expression substitution to
make the reference.
2016-10-31 17:05:06 +00:00
Paul Stack ed49da8bb1 provider/aws: Add support for reference_name to aws_route53_health_check (#9737)
Fixes #8679

The CallerReference attribute we passed to AWS in route53_health_checks
was `time.Now().Format(time.RFC3339Nano)`

When creating multiple resources with the Count meta-parameter, this was
causing issues as follows:

```
* aws_route53_health_check.healthstate.0: HealthCheckAlreadyExists: A different health check has already been created with the specified caller reference.
```

We have now exposed a new attribute called `reference_name` that can be set to pass multiple resources to the request

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRoute53HealthCheck_'                              130 ↵ ✹
==> Cecking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/31 10:41:07 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRoute53HealthCheck_ -timeout 120m
=== RUN   TestAccAWSRoute53HealthCheck_importBasic
--- PASS: TestAccAWSRoute53HealthCheck_importBasic (17.08s)
=== RUN   TestAccAWSRoute53HealthCheck_basic
--- PASS: TestAccAWSRoute53HealthCheck_basic (28.17s)
=== RUN   TestAccAWSRoute53HealthCheck_withSearchString
--- PASS: TestAccAWSRoute53HealthCheck_withSearchString (28.07s)
=== RUN   TestAccAWSRoute53HealthCheck_withChildHealthChecks
--- PASS: TestAccAWSRoute53HealthCheck_withChildHealthChecks (20.71s)
=== RUN   TestAccAWSRoute53HealthCheck_IpConfig
--- PASS: TestAccAWSRoute53HealthCheck_IpConfig (16.09s)
=== RUN   TestAccAWSRoute53HealthCheck_CloudWatchAlarmCheck
--- PASS: TestAccAWSRoute53HealthCheck_CloudWatchAlarmCheck (22.42s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	132.568s
```
2016-10-31 16:00:40 +00:00
Clint f446f7f2be Merge pull request #9667 from hashicorp/b-aws-lambda-mutex
provider/aws: Limit AWS Lambda source uploads
2016-10-31 08:51:08 -05:00
Paul Stack 92f48ad243 provider/aws: Update aws_appautoscaling_target_test (#9736)
The update of the test was causing a test failure - it was setting
desired_count to 1 when miz_size was set to 2 - this was causing a
perpetual diff in the test
2016-10-31 10:40:35 +00:00
Paul Stack 3accd5485a provider/aws: Make iam_user_policy_attachment_test work as expected: (#9733)
Was failing due to using IAM user `test-name` as it was being used in
more than 1 place - this has been replaced by a random user and random
policy names now

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSUserPolicyAttachment_basic'                                                                               2 ↵ ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/10/31 08:39:08 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSUserPolicyAttachment_basic -timeout 120m
=== RUN   TestAccAWSUserPolicyAttachment_basic
--- PASS: TestAccAWSUserPolicyAttachment_basic (32.04s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	32.053s
```
2016-10-31 09:52:38 +00:00
Martin Atkins ea0bc04277 provider/aws: aws_ami: handle deletion of AMIs (#9721)
Previously this resource (and, by extension, the aws_ami_copy and
aws_ami_from_instance resources that share much of its implementation)
was handling correctly the case where an AMI had been recently
deregistered, and was thus still returned from the API, but not correctly
dealing with the situation where the AMI has been removed altogether.

Now we additionally handle the NotFound error returned by the API when
we request a non-existent AMI, and remove the AMI from the state in the
same way we do for deregistered AMIs.
2016-10-31 09:51:59 +00:00
Anshul Sharma 625e747359 Added AWS Resource WAF XssMatchSet (#9710) 2016-10-31 08:51:08 +00:00
Masayuki Morita eb1a58d966 Update doc: aws_iam_user with force_destroy deletes IAM User Login Profile (#9716)
refs: https://github.com/hashicorp/terraform/pull/9583
2016-10-29 16:20:18 +01:00
Clint 01e8bd1f70 provider/aws: Fix import of RouteTable with destination prefixes (#9686)
* add test failure

* provider/aws: Skip import of routes that contain destination prefix ids
2016-10-29 01:01:17 +02:00
Anshul Sharma cc8f11138f Added AWS Resource WAF SizeConstraintSet (#9689) 2016-10-29 00:58:37 +02:00
Andras Ferencz-Szabo 46cb7b4710 Allow underscores in IAM user and group names (#9684)
* Allow underscores in IAM user and group names

* Add notes to iam_user and iam_group docs that names are not distinguished by case
2016-10-28 14:40:04 +02:00
Anshul Sharma afc603c0f8 Added AWS Resource WAF ByteMatchSet (#9681) 2016-10-28 14:36:16 +02:00
Liam Bennett 8fee7642a9 New AWS resource `ssm_activation` (#9111)
Adding a new resource to support activation of managed instances for
on-premise virtual-machines.
2016-10-28 11:59:12 +02:00