Commit Graph

3317 Commits

Author SHA1 Message Date
Clint f8f4634858 Merge pull request #10492 from Ninir/lambda_env_removal
provider/aws: Fixed Lambda environment removal
2016-12-05 14:33:11 -06:00
Jan Schumann 9e293def6a provider/aws: Add opsworks rds db resource (#10294)
* add rds db for opsworks

* switched to stack in vpc

* implement update method

* add docs

* implement and document force new resource behavior

* implement retry for update and delete

* add test that forces new resource
2016-12-05 16:14:15 +00:00
Clint e477658832 Merge pull request #10473 from hashicorp/f-aws-lightsail-instance
provider/aws: Add Lightsail Instance
2016-12-05 08:39:17 -06:00
Daniel del Castillo 08da905374 aws-emr-cluster: Assign correct number of core instances (n-1) on update (#10529) 2016-12-05 14:17:29 +00:00
Evgeny Chuvpilo 8586e323dc
provider/aws: Add support for termination protection and autotermination to EMR. 2016-12-05 13:54:00 +00:00
Mitchell Hashimoto e014cf3d83 providers/aws: cloudfront distribution 404 should mark as gone (#10281) 2016-12-05 13:31:05 +00:00
Kit Ewbank 26d0525e82 Add new aws_vpc_endpoint_route_table_association resource (#10137)
* Add new aws_vpc_endpoint_route_table_association resource.

This commit adds a new resource which allows to a list of route tables to be
either added and/or removed from an existing VPC Endpoint. This resource would
also be complimentary to the existing `aws_vpc_endpoint` resource where the
route tables might not be specified (not a requirement for a VPC Endpoint to
be created successfully) during creation, especially where the workflow is
such where the route tables are not immediately known.

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

Additions by Kit Ewbank <Kit_Ewbank@hotmail.com>:

* Add functionality
* Add documentation
* Add acceptance tests
* Set VPC endpoint route_table_ids attribute to "Computed"

* Changes after review - Set resource ID in create function.

* Changes after code review by @kwilczynski:
* Removed error types and simplified the error handling in 'resourceAwsVPCEndpointRouteTableAssociationRead'
* Simplified logging in 'resourceAwsVPCEndpointRouteTableAssociationDelete'
2016-12-05 12:55:37 +00:00
clint shryock 44ffe71695 provider/aws: Add Lightsail Instance
Adds initial support for AWS Lightsail Instances
2016-12-02 16:35:57 -06:00
Ninir 615da28b6e provider/aws: Fixed Lambda environment removal 2016-12-02 14:36:55 +01:00
Ninir 1d090eb1ab provider/aws: Added s3 bucket region attribute management (#10482) 2016-12-02 14:22:47 +02:00
Jan Schumann 2e83eb1cfe fix #9104 (#10394) 2016-12-02 13:53:06 +02:00
Jan Schumann b8caddda21 provider/aws resource_aws_opsworks_application does not accept document_root parameter (#10477)
* switched to stack in vpc

* validate also on update

* validate attributes based on app type
2016-12-02 13:45:10 +02:00
Paul Stack ac257b8048 provider/aws: Fix aws_iam_role_test config (#10464)
```
% make testacc TEST=./builtin/providers/aws
% TESTARGS='-run=TestAccAWSRole_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/01 17:17:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRole_
-timeout 120m
=== RUN   TestAccAWSRole_basic

--- PASS: TestAccAWSRole_basic (15.38s)
=== RUN   TestAccAWSRole_namePrefix
--- PASS: TestAccAWSRole_namePrefix (14.89s)
=== RUN   TestAccAWSRole_testNameChange
--- PASS: TestAccAWSRole_testNameChange (34.43s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws64.729s
```
2016-12-01 18:22:05 +02:00
stack72 4e0ebfde3f
provider/aws: removal of the duplicate import aws_iam_instance_profile test 2016-12-01 16:55:53 +02:00
stack72 a4dba89553
provider/aws: Fixing the broken build of the aws_iam_policy resource 2016-12-01 16:50:28 +02:00
stack72 7497a295b8
provider/aws: Fixing the broken build of the aws_iam_role resource 2016-12-01 16:46:01 +02:00
stack72 8369ab44ec
provider/aws: Fixing the broken build of the aws_iam_policy resource 2016-12-01 16:44:40 +02:00
Tom Wilkie 71e8cffeea
Allow importing of aws_iam_role, aws_iam_role_policy, aws_iam_policy and aws_iam_instance_profile 2016-12-01 16:41:23 +02:00
Raymond Fallon 7b672d4656 Automatic Rollback of CodeDeploy deployments and CloudWatch Alarms for a Deployment Group (#9039)
* provider/aws: Add DeploymentRollback as a valid TriggerEvent type

* provider/aws: Add auto_rollback_configuration to aws_codedeploy_deployment_group

* provider/aws: Document auto_rollback_configuration

  - part of aws_codedeploy_deployment_group

* provider/aws: Support removing and disabling auto_rollback_configuration

  - part of aws_codedeploy_deployment_group resource
  - when removing configuration, ensure events are removed
  - when disabling configuration, preserve events in case configuration is re-enabled

* provider/aws: Add alarm_configuration to aws_codedeploy_deployment_group

* provider/aws: Document alarm_configuration

  - part of aws_codedeploy_deployment_group

* provider/aws: Support removing alarm_configuration

  - part of aws_codedeploy_deployment_group resource
  - disabling configuration doesn't appear to work...

* provider/aws: Refactor auto_rollback_configuration tests

  - Add create test
  - SKIP failing test for now
  - Add tests for build & map functions

* provider/aws: Refactor new aws_code_deploy_deployment_group tests

  - alarm_configuration and auto_rollback_configuration only
  - add assertions to deployment_group basic test
  - rename config funcs to be more easy to read
  - group public tests together

* provider/aws: A max of 10 alarms can be added to a deployment group.

  - aws_code_deploy_deployment_group.alarm_configuration.alarms
  - verified this causes test failure with expected exception

* provider/aws: Test disabling alarm_configuration and auto_rollback_configuration

  - the tests now pass after rebasing the latest master branch
2016-12-01 16:12:14 +02:00
Tom Wilkie 8029931086 Do not return a root device for instance store backed AMIs. (#9483)
* Do not return a root device for instance store backed AMIs.

* Add root EC2 instance store acceptance test.
2016-12-01 15:53:14 +02:00
Colin Woodbury a5f8352e11 Increase `aws_emr_cluster` timeout to 75 minutes (#10444) 2016-12-01 12:05:40 +02:00
Paul Stack 83abf5b16a provider/aws: Support import of aws_iam_instance_profile (#10436)
Fixes #10341

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSIAMInstanceProfile_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/30 14:32:59 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSIAMInstanceProfile_ -timeout 120m
=== RUN   TestAccAWSIAMInstanceProfile_importBasic
--- PASS: TestAccAWSIAMInstanceProfile_importBasic (20.22s)
=== RUN   TestAccAWSIAMInstanceProfile_basic
--- PASS: TestAccAWSIAMInstanceProfile_basic (18.71s)
=== RUN   TestAccAWSIAMInstanceProfile_namePrefix
--- PASS: TestAccAWSIAMInstanceProfile_namePrefix (18.58s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws57.535s
```
2016-12-01 09:01:15 +02:00
Anshul Sharma a886b630a0 IPv6 Support To Cloudfront (#10332)
* Added IPv6 Support To Cloudfront

* Added IPv6 docs to cloudfront
2016-11-30 14:13:30 +02:00
Ninir 5481e9ecb3 provider/aws: Enforced kms_key_* attributes to be ARNs (#10356)
* Added kms_key_* validation to force ARNs

* Added Redshift Cluster KMS key test

* Added cloudtrail kms key test

* Added EBS volume kms key

* Added Elastic Transcoder Pipeline kms key arn test
2016-11-30 13:50:26 +02:00
cagriy 8cdafe0508 typo corrected in structure.go (#10415) 2016-11-29 15:49:34 +00:00
Mathieu Herbert aec4e56f68
provider/aws: data source for AWS Route Table 2016-11-28 18:07:38 +00:00
James Nugent aa8c2ac587 provider/aws: Randomize names for Parameter Group tests
This should allow tests to run concurrently.
2016-11-25 21:48:54 +00:00
James Nugent 08b860290a provider/aws: Generate random names for Beanstalk tests resources (#10367)
* provider/aws: Generate name for TestAccElasticBeanstalkApplicationImport

This allows tests to run concurrently.

* provider/aws: Generate names for TestAWSElasticBeanstalkEnvironment_importBasic

This allows tests to run concurrently.
2016-11-25 15:44:41 +00:00
Paul Stack b77dac5ab8 provider/aws: Randomize redshift subnet group test names (#10366) 2016-11-25 15:37:19 +00:00
Paul Stack 3d3609c271 provider/aws: Fixing up acceptance tests after seeing concurrent (#10362)
failures

* codecommit
* cloudwatch_logs
2016-11-25 12:50:19 +00:00
Dan Everton 3be29ab5d0 Handle empty Lambda environment. (#10306)
The Lambda environment will be nil if the function has never had an
environment applied. Fixes #10302
2016-11-23 18:36:16 +02:00
Kit Ewbank 7319968f5f Skip VPC endpoint routes when removing default route table's routes. (#10303) 2016-11-23 18:12:59 +02:00
clint shryock 2eb132c55a provider/aws: Patch issue with enable dns support 2016-11-22 13:44:44 -06:00
Masayuki Morita f85e0b7249 Add JSON validation to the aws_iam_policy resource (#10239)
Although the aws_iam_policy has a problem of normalization (refs #8350),
I think it would be useful simply to add JSON syntax validation.
I wasted a lot of time with JSON syntax errors.

Validate the aws_iam_policy using the validateJsonString helper.
2016-11-22 13:35:15 +02:00
Ninir b52813b639 provider/aws: added auto_minor_version_upgrade on aws_rds_cluster_instance (#10284) 2016-11-22 13:33:01 +02:00
clint shryock dede6f7302 provider/aws: Reformat and detect drift for Lambda VPC, environment 2016-11-21 17:10:32 -06:00
Ninir ab9059564c provider/aws: Added Lambda Environment configuration 2016-11-21 22:23:39 +01:00
Paul Stack b3fad6a68c provider/aws: Addition of suspended_processes to aws_autoscaling_group (#10096)
Fixes #8954

Addition of the support of autoScaling group suspended_processes
2016-11-21 17:02:20 +02:00
Paul Stack 7fde952d02 provider/aws: New Resource aws_ebs_snapshot (#10017)
* provider/aws: Add ability to create aws_ebs_snapshot

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEBSSnapshot_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/10 14:18:36 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSEBSSnapshot_
-timeout 120m
=== RUN   TestAccAWSEBSSnapshot_basic
--- PASS: TestAccAWSEBSSnapshot_basic (31.56s)
=== RUN   TestAccAWSEBSSnapshot_withDescription
--- PASS: TestAccAWSEBSSnapshot_withDescription (189.35s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws220.928s
```

* docs/aws: Addition of the docs for aws_ebs_snapshot resource

* provider/aws: Creation of shared schema funcs for common AWS data source
patterns

* provider/aws: Create aws_ebs_snapshot datasource

Fixes #8828

This data source will use a number of filters, owner_ids, snapshot_ids
and restorable_by_user_ids in order to find the correct snapshot. The
data source has no real use case for most_recent and will error on no
snapshots found or greater than 1 snapshot found

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEbsSnapshotDataSource_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/10 14:34:33 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEbsSnapshotDataSource_ -timeout 120m
=== RUN   TestAccAWSEbsSnapshotDataSource_basic
--- PASS: TestAccAWSEbsSnapshotDataSource_basic (192.66s)
=== RUN   TestAccAWSEbsSnapshotDataSource_multipleFilters
--- PASS: TestAccAWSEbsSnapshotDataSource_multipleFilters (33.84s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws226.522s
```

* docs/aws: Addition of docs for the aws_ebs_snapshot data source

Adds the new resource `aws_ebs_snapshot`
2016-11-21 12:40:22 +02:00
Chris Marchesi 67d162a126 provider/aws: aws_autoscaling_group ALB target group support (#10243)
This update adds ALB support to the
wait_for_elb_capacity/min_elb_capacity options. Target groups are
handled in nearly the same way as Classic ELBs, so the change should be
transparent. This supports both ALB target groups and classic ELBs being
attached to the ASG at the same time.
2016-11-21 11:50:58 +02:00
Kit Ewbank 7330d65678 provider/aws Return service CIDR blocks from aws_vpc_endpoint resource. (#10254) 2016-11-21 10:43:56 +02:00
Chris Marchesi 4845f8de39 provider/aws: Add aws_alb data source (#10196)
* provider/aws: Add aws_alb data source

This adds the aws_alb data source for getting information on an AWS
Application Load Balancer.

The schema is nearly the same as the resource of the same name, with
most of the resource population logic de-coupled into its own function
so that they can be shared between the resource and data source.

* provider/aws: aws_alb data source language revisions

 * Multiple/zero result error slightly updated to be a bit more
   specific.
 * Fixed relic of the copy of the resource docs (resource -> data
   source)
2016-11-21 10:27:44 +02:00
Richard Henning 2a5e1d400d provider/aws: Remove IAM user's MFA devices with `force_destroy` #5908 (#10262)
When `force_destroy` was specifed on an `aws_iam_user` resource, only IAM
access keys and the login profile were destroyed. If a multi-factor auth
device had been activated for that user, deletion would fail as follows:

```
* aws_iam_user.testuser1: Error deleting IAM User testuser1: DeleteConflict: Cannot delete entity, must delete MFA device first.
    status code: 409, request id: aa41b1b7-ac4d-11e6-bb3f-3b4c7a310c65
```

This commit iterates over any of the user's MFA devices and deactivates
them before deleting the user. It follows a pattern similar to that used
to remove users' IAM access keys before deletion.

```
$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSUser_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/20 17:09:00 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSUser_ -timeout 120m
=== RUN   TestAccAWSUser_importBasic
--- PASS: TestAccAWSUser_importBasic (5.70s)
=== RUN   TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (11.12s)
PASS
ok  	github.com/rhenning/terraform/builtin/providers/aws	20.840s
```
2016-11-21 10:17:27 +02:00
Kit Ewbank fd8d41f6a5 Add note to aws_security_group data source describing the default security group for a VPC. (#10247)
Add a corresponding acceptance test.
2016-11-20 16:28:11 +02:00
Kit Ewbank 3255921b6e aws_prefix_list data source - Add ability to select PL by name. (#10248) 2016-11-20 16:21:55 +02:00
Chris Marchesi 3ac05a539b provider/aws: Add aws_alb_listener data source (#10181)
* provider/aws: Add aws_alb_listener data source

This adds the aws_alb_listener data source to get information on an AWS
Application Load Balancer listener.

The schema is slightly modified (only option-wise, attributes are the
same) and we use the aws_alb_listener resource read function to get the
data.

Note that the HTTPS test here may fail due until
hashicorp/terraform#10180 is merged.

* provider/aws: Add aws_alb_listener data source docs

Now documented.
2016-11-18 13:01:21 +02:00
Chris Marchesi 99528f17cd provider/aws: Add CertificateNotFound retry waiter to aws_alb_listener (#10180)
Looks like sometimes it takes some time for IAM certificates to
propagate, which can cause errors on ALB listener creation.
Possibly same thing as hashicorp/terraform#5178, but for ALB
now instead of ELB.

This was discovered via acceptance tests, specifically the
TestAccAWSALBListener_https test. Updated the creation process to wait
on CertificateNotFound for a max of 5min.
2016-11-17 14:49:41 +02:00
Andrew Garrett 3822c69995 Add name_prefix to aws_iam_policy (#10178)
This is intended to behave the same way as name_prefix does in
aws_iam_role.

Fixes #10176
2016-11-17 14:03:03 +02:00
Clint d004a24659 Merge pull request #10171 from Ninir/vpc_enable_dns_support
provider/aws: Fixed the aws_vpc enable_dns_support handling on creation
2016-11-16 13:41:35 -06:00
Ninir 281eba72ad provider/aws: Fixed the aws_vpc enable_dns_support handling on creation 2016-11-16 20:05:49 +01:00