Commit Graph

2669 Commits

Author SHA1 Message Date
Radek Simko b8d21330a7 provider/aws: Allow importing lambda_function (#7610) 2016-07-16 15:36:28 +01:00
stack72 6468b899b9
provider/aws: Fix the AMI ID in the test for VPC Classic Link 2016-07-16 15:17:37 +01:00
Andrew Sy Kim e85297f958 provider/aws: Allow VPC Classic Linking in Autoscaling Launch Configs (#7470)
* support for vpc linking ec2 instances in launch configs

* add acceptance testing

* generate vpc and security groups for each test run
2016-07-16 15:13:29 +01:00
David Harris 03157610d8 provider/aws: Read Elastic Beanstalk stack name (#7671) 2016-07-16 14:43:12 +01:00
Paul Hinze 71932138b9 Merge pull request #7667 from hashicorp/phinze/skip-final-snapshot-import
provider/aws: Fixup skip_final_snapshot import
2016-07-15 13:34:37 -06:00
David Harris bbe7fd2613 provider/aws: Fix Elastic Beanstalk test (#7668)
This fixes the `TestAccAWSBeanstalkEnv_tier` test. The instance profile
needs access to send and receive messages from its sqs queue. Without
these permissions Beanstalk returns an error event, causing the test to
fail.
2016-07-15 20:03:42 +01:00
Paul Hinze 93832527b1
provider/aws: Fixup skip_final_snapshot import
Neither skip_final_snapshot nor final_snapshot_identifier can be fetched
from any API call, so we need to default skip_final_snapshot to true
during import so that final_snapshot_identifier is not required
2016-07-15 11:30:33 -06:00
James Nugent 082c4fc2c8 Merge pull request #7538 from hashicorp/import-aws-sqs
provider/aws: Support Import `aws_sqs_queue`
2016-07-14 13:29:19 -06:00
stack72 3d480ca767
provider/aws: Support Import `aws_sqs_queue`
Needed to change the test due to SQS having issues recreating the same
queue multiple times. Now it uses a random name

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSQSQueue_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSQSQueue_
-timeout 120m
=== RUN   TestAccAWSSQSQueue_importBasic
--- PASS: TestAccAWSSQSQueue_importBasic (20.53s)
=== RUN   TestAccAWSSQSQueue_basic
--- PASS: TestAccAWSSQSQueue_basic (33.85s)
=== RUN   TestAccAWSSQSQueue_redrivePolicy
--- PASS: TestAccAWSSQSQueue_redrivePolicy (26.59s)
=== RUN   TestAccAWSSQSQueue_Policybasic
--- PASS: TestAccAWSSQSQueue_Policybasic (36.92s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    117.908s
```
2016-07-13 22:36:28 +01:00
James Nugent 28438daeb4 provider/aws: Fix IDs in aws_iam_policy_document
We cannot use the "id" field to represent policy ID, because it is used
internally by Terraform. Also change the "id" field within a statement
to "sid" for consistency with the generated JSON.
2016-07-13 12:10:20 -06:00
Clint 3cea29176f provider/aws: Safely get ELB values (#7585)
- removes dereferences to avoid nil crashes
2016-07-13 10:07:56 +01:00
Justin Nauman 71532fff8b - Adding in additional retry logic due to latency with AWS delete (#7312) 2016-07-12 13:19:55 -06:00
Radek Simko df40b91fb8 provider/aws: Allow importing iam_saml_provider (#7605) 2016-07-12 17:04:01 +01:00
Paul Stack 7a58ad95f5 provider/aws: Support Import for `aws_simpledb_domain` (#7601)
```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSimpleDBDomain_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSSimpleDBDomain_ -timeout 120m
=== RUN   TestAccAWSSimpleDBDomain_importBasic
--- PASS: TestAccAWSSimpleDBDomain_importBasic (19.59s)
=== RUN   TestAccAWSSimpleDBDomain_basic
--- PASS: TestAccAWSSimpleDBDomain_basic (19.93s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    39.535s
```
2016-07-12 13:15:47 +01:00
Martin Häger 32abd937f1 SimpleDB domain resource (#7600) 2016-07-12 12:55:58 +01:00
Paul Stack 303ba86cf6 provider/aws: Allow `port` on `aws_db_instance` to be updated (#7441)
Fixes #2439

Port used to ForceNew, it has now been changed to allow it to be
updated. 2 changes were needed:

1. Setting the port back to state
2. Adding the wait for state function to the Update func

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBInstance_portUpdate'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBInstance_portUpdate -timeout 120m
=== RUN   TestAccAWSDBInstance_portUpdate
--- PASS: TestAccAWSDBInstance_portUpdate (699.84s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    699.861s
```
2016-07-12 09:07:25 +01:00
Radek Simko 8fa75ea383 provider/aws: Allow import of KMS key (#7599) 2016-07-12 08:49:33 +01:00
Radek Simko 40e05ecc33 provider/aws: Allow import of glacier_vault (#7596) 2016-07-12 08:49:26 +01:00
Radek Simko 86c1661205 provider/aws: Allow import of efs_mount_target 2016-07-12 00:18:13 +01:00
Radek Simko f5ef8f36c2 provider/aws: Allow import of efs_file_system 2016-07-12 00:02:47 +01:00
clint shryock edd67547bc remove debug statements 2016-07-11 15:12:15 -06:00
stack72 ceeab2ad12 provider/aws: Support Import for `aws_api_gateway_key`
Previously, the `stage_key` were not being set back to state in the Read
func. Changing this means the tests now run as follows:

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAPIGatewayApiKey_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSAPIGatewayApiKey_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayApiKey_importBasic
--- PASS: TestAccAWSAPIGatewayApiKey_importBasic (42.42s)
=== RUN   TestAccAWSAPIGatewayApiKey_basic
--- PASS: TestAccAWSAPIGatewayApiKey_basic (42.11s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    84.549s
```
2016-07-11 15:11:30 -06:00
Paul Stack ea4483d8b6 provider/aws: Support Import `aws_rds_cluster_instance` (#7522)
We were not setting all the values in the read Func. One other issue, we
were setting the *wrong* db_parameter_name value to state

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRDSClusterInstance_import'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRDSClusterInstance_import -timeout 120m
=== RUN   TestAccAWSRDSClusterInstance_importBasic
--- PASS: TestAccAWSRDSClusterInstance_importBasic (1201.80s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1201.814s
```
2016-07-11 14:59:14 -06:00
Paul Stack 38e3d3ba87 provider/aws: Support Import `aws_cloudfront_origin_access_identity` (#7506)
* provider/aws: Support Import `aws_cloudfront_origin_access_identity`

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudFrontOriginAccessIdentity_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSCloudFrontOriginAccessIdentity_ -timeout 120m
=== RUN   TestAccAWSCloudFrontOriginAccessIdentity_importBasic
--- PASS: TestAccAWSCloudFrontOriginAccessIdentity_importBasic (17.07s)
=== RUN   TestAccAWSCloudFrontOriginAccessIdentity_basic
--- PASS: TestAccAWSCloudFrontOriginAccessIdentity_basic (15.34s)
=== RUN   TestAccAWSCloudFrontOriginAccessIdentity_noComment
--- PASS: TestAccAWSCloudFrontOriginAccessIdentity_noComment (16.29s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    48.717s
```

* Update import_aws_cloudfront_origin_access_identity_test.go
2016-07-11 14:58:25 -06:00
Paul Stack 743be7914d provider/aws: Refresh CloudWatch Group from state on 404 (#7576)
Fixes #7543 where creating a CloudWatch Group, then deleting it from the
console will cause no action on refresh / plan

```
% make testacc TEST=./builtin/providers/aws  TESTARGS='-run=TestAccAWSCloudWatchLogGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSCloudWatchLogGroup_ -timeout 120m
=== RUN   TestAccAWSCloudWatchLogGroup_importBasic
--- PASS: TestAccAWSCloudWatchLogGroup_importBasic (18.10s)
=== RUN   TestAccAWSCloudWatchLogGroup_basic
--- PASS: TestAccAWSCloudWatchLogGroup_basic (17.34s)
=== RUN   TestAccAWSCloudWatchLogGroup_retentionPolicy
--- PASS: TestAccAWSCloudWatchLogGroup_retentionPolicy (49.81s)
=== RUN   TestAccAWSCloudWatchLogGroup_multiple
--- PASS: TestAccAWSCloudWatchLogGroup_multiple (23.74s)
=== RUN   TestAccAWSCloudWatchLogGroup_disappears
--- PASS: TestAccAWSCloudWatchLogGroup_disappears (15.78s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    124.789s
```
2016-07-11 12:06:44 -06:00
James Nugent 4c05fddd9b Merge pull request #7530 from hashicorp/aws-codedeployment-manual
provider/aws: Remove `aws_codedeploy_deployment_group` from state on 404
2016-07-08 11:05:06 +01:00
James Nugent 73682c93a7 Merge pull request #7541 from hashicorp/import-aws-redshiftcluster
provider/aws: Support Import of `aws_redshift_cluster`
2016-07-08 11:01:28 +01:00
James Nugent 66a2fe61a4 Merge pull request #7540 from hashicorp/import-aws-receiptfilter
provider/aws: Support Import of `aws_ses_receipt_filter`
2016-07-08 11:00:36 +01:00
James Nugent f5bb652bd6 Merge pull request #7539 from hashicorp/import-aws-receiptruleset
provider/aws: Support Import of `aws_ses_receipt_rule_set`
2016-07-08 11:00:17 +01:00
James Nugent a89fd9d0de Merge pull request #7537 from hashicorp/import-aws-dboption
provider/aws: Support Import of `aws_db_option_group`
2016-07-08 10:59:00 +01:00
James Nugent dfe2ee5a30 Merge pull request #7536 from hashicorp/import-aws-db_instance
provider/aws: Support Import of `aws_db_instance`
2016-07-08 10:58:37 +01:00
David Tolnay db627798e6 provider/aws: Handle spurious failures in resourceAwsSecurityGroupRuleRead (#7377)
Previously, any old HTTP error would be treated as the security_group_rule being
deleted. In reality there are only a few cases where this is the right
assumption.
2016-07-07 16:06:02 -05:00
David Tolnay a86d766bd2 provider/aws: internetgateway timing tweaks (again) (#7447)
This workaround is originally from 71b30c633f.
According to the commit message from Mitchell Hashimoto:

    So I think the AWS API is just broken here. In the case that the state
    doesn't update, just assume it did after 5 seconds.

Based on my experience, this AWS API is still broken in the same way.

The timeout was later increased from 5 seconds to 10 seconds in
265cc4fffa.

The timeout (but not the timer) was removed inexplicably in GH-1325.

The symptom is this error from `terraform apply`:

    aws_internet_gateway.test: Error waiting for internet gateway (igw-553b4731) to attach: timeout while waiting for state to become '[available]'

followed by all subsequent `terraform apply` commands failing with this error:

    aws_internet_gateway.test: Resource.AlreadyAssociated: resource igw-553b4731 is already attached to network vpc-61bc7606
2016-07-07 15:45:28 -05:00
David Tolnay 2943a1c978 Retry creation of IAM role depending on new IAM user (#7324) 2016-07-07 15:24:17 -05:00
stack72 a746b28fc1
provider/aws: Support Import of `aws_redshift_cluster`
```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftCluster_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRedshiftCluster_importBasic -timeout 120m
=== RUN   TestAccAWSRedshiftCluster_importBasic
--- PASS: TestAccAWSRedshiftCluster_importBasic (623.52s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    623.546s
```
2016-07-07 18:27:13 +01:00
Clint 17931c7099 Merge pull request #7511 from hashicorp/pr-7319
provider/aws: AWS prefix lists to enable security group egress to a VPC Endpoint (supersedes #7319)
2016-07-07 12:10:10 -05:00
stack72 a74bd870e2
provider/aws: Support Import of `aws_ses_receipt_filter`
```
% make testacc TEST=./builtin/providers/aws  TESTARGS='-run=TestAccAWSSESReceiptFilter_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSSESReceiptFilter_ -timeout 120m
=== RUN   TestAccAWSSESReceiptFilter_importBasic
--- PASS: TestAccAWSSESReceiptFilter_importBasic (18.18s)
=== RUN   TestAccAWSSESReceiptFilter_basic
--- PASS: TestAccAWSSESReceiptFilter_basic (18.42s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    36.633s
```
2016-07-07 17:37:56 +01:00
stack72 aa6e23bc4b
provider/aws: Support Import of `aws_ses_receipt_rule_set`
```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSESReceiptRuleSet_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSSESReceiptRuleSet_ -timeout 120m
=== RUN   TestAccAWSSESReceiptRuleSet_importBasic
--- PASS: TestAccAWSSESReceiptRuleSet_importBasic (18.60s)
=== RUN   TestAccAWSSESReceiptRuleSet_basic
--- PASS: TestAccAWSSESReceiptRuleSet_basic (26.92s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    45.550s
```
2016-07-07 17:30:03 +01:00
stack72 6f122c3f05
provider/aws: Support Import of `aws_db_option_group`
```
make testacc TEST=./builtin/providers/aws
TESTARGS='-run=TestAccAWSDBOptionGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBOptionGroup_ -timeout 120m
=== RUN   TestAccAWSDBOptionGroup_importBasic
--- PASS: TestAccAWSDBOptionGroup_importBasic (22.98s)
=== RUN   TestAccAWSDBOptionGroup_basic
--- PASS: TestAccAWSDBOptionGroup_basic (22.54s)
=== RUN   TestAccAWSDBOptionGroup_OptionSettings
--- PASS: TestAccAWSDBOptionGroup_OptionSettings (38.62s)
=== RUN   TestAccAWSDBOptionGroup_sqlServerOptionsUpdate
--- PASS: TestAccAWSDBOptionGroup_sqlServerOptionsUpdate (37.64s)
=== RUN   TestAccAWSDBOptionGroup_multipleOptions
--- PASS: TestAccAWSDBOptionGroup_multipleOptions (24.32s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    146.123s
```
2016-07-07 16:45:56 +01:00
stack72 80aeabec83
provider/aws: Support Import of `aws_db_instance`
JUst needed some rejigging of the skip_final_snapshot work as that isn't
returned by the API and skipping it means the destroy fails due to
missing final_snapshot_identifier

```
% make testacc TEST=./builtin/providers/aws
% TESTARGS='-run=TestAccAWSDBInstance_'                              ✹ ✭
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
2016/07/07 15:28:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSDBInstance_
-timeout 120m
=== RUN   TestAccAWSDBInstance_importBasic
--- PASS: TestAccAWSDBInstance_importBasic (588.70s)
=== RUN   TestAccAWSDBInstance_basic
--- PASS: TestAccAWSDBInstance_basic (595.71s)
=== RUN   TestAccAWSDBInstance_kmsKey
--- PASS: TestAccAWSDBInstance_kmsKey (726.46s)
=== RUN   TestAccAWSDBInstance_optionGroup
--- PASS: TestAccAWSDBInstance_optionGroup (681.78s)
=== RUN   TestAccAWSDBInstance_iops_update
--- PASS: TestAccAWSDBInstance_iops_update
(590.81s)
```

Please note that I cannot run the enhanced monitoring test in my
environment as I have already got it attached to an IAM role. Running
that test gives me this result:

```

```
2016-07-07 16:26:35 +01:00
stack72 53681390d4
provider/aws: Remove `aws_codedeploy_deployment_group` from state on 404
Fixes #4802

The manual removal will now force Terraform to remove the resource from
state and then report it needs recreated
2016-07-07 13:59:39 +01:00
clint shryock 1d488bdbd2 provider/aws: Do an extra lookup for the VPC Endpoint Prefix, to test Prefix 2016-07-06 09:20:39 -05:00
David Tolnay 4ba75bd54e Retry finding route after creating it (#7463)
The symptom is that a route "fails" to create, then every subsequent
`terraform apply` fails with RouteAlreadyExists.

CreateRoute was succeeding but the very next DescribeRouteTables
was not listing the new route.
2016-07-05 15:04:09 -05:00
Paul Stack d60594695f provider/aws: `aws_customer_gateway` refreshing from state on deleted (#7482)
state

Fixes #7136
2016-07-05 16:34:06 +01:00
Paul Stack 58c324676d provider/aws: Add support for `encryption` and `kms_key_id` to `aws_ami` (#7181)
This fixes #7157. It doesn't change the way aws_ami works

```
make testacc TEST=./builtin/providers/aws
TESTARGS='-run=TestAccAWSAMICopy'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAMICopy
-timeout 120m
=== RUN   TestAccAWSAMICopy
--- PASS: TestAccAWSAMICopy (479.75s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    479.769s
```
2016-07-05 09:50:48 -05:00
Paul Stack 06ff7bfcfe provider/aws: Remove EFS File System from State when NotFound (#7437)
Fixes #7433

When an EFS File System is created via Terraform, Deleted from the AWS
console, then Terraform would give us as error as:

```
* aws_efs_file_system.file_system: FileSystemNotFound: File system
 'fs-9d739e54' does not exist.
        status code: 404, request id:
        d505a682-3ec7-11e6-81d3-1d41202f0881
```

On a 404, we now remove the EFS File System from state so that Terraform
can recreate it as expected
2016-07-05 13:56:05 +01:00
James Nugent 730d59734f Merge pull request #7338 from hashicorp/import-aws-dbpg
provider/aws: Support Import for `aws_db_parameter_group`
2016-07-05 13:51:51 +01:00
Radek Simko 120d7c4f2e provider/aws: Only allow max. 1 health_check block for ELB 2016-07-05 10:56:17 +01:00
Eric Rutherford 32051156c7 adding states that should be considered as deleted for vpc peering (#7466) 2016-07-03 16:58:19 +01:00
David Harris c744bb6fa8 provider/aws: import Elastic Beanstalk Application and Environment (#7444) 2016-07-03 16:42:12 +01:00