Commit Graph

83 Commits

Author SHA1 Message Date
Clint d2f728e6cd provider/aws: Only send iops when creating io1 devices. Fix docs (#12392) 2017-03-07 14:44:39 +02:00
stack72 0d4f4cac18
provider/aws: Adding a test that covers the new IAM Instance Profile
association to AWS Instance
2017-03-02 10:38:33 +00:00
Paul Stack 177400dbbf provider/aws: Implement IPV6 Support for ec2 / VPC (#10538)
* provider/aws: Add support for IPV6 enabled VPC

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpc'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/09 14:07:31 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpc -timeout 120m
=== RUN   TestAccAWSVpc_importBasic
--- PASS: TestAccAWSVpc_importBasic (43.03s)
=== RUN   TestAccAWSVpc_basic
--- PASS: TestAccAWSVpc_basic (36.32s)
=== RUN   TestAccAWSVpc_enableIpv6
--- PASS: TestAccAWSVpc_enableIpv6 (29.37s)
=== RUN   TestAccAWSVpc_dedicatedTenancy
--- PASS: TestAccAWSVpc_dedicatedTenancy (36.63s)
=== RUN   TestAccAWSVpc_tags
--- PASS: TestAccAWSVpc_tags (67.54s)
=== RUN   TestAccAWSVpc_update
--- PASS: TestAccAWSVpc_update (66.16s)
=== RUN   TestAccAWSVpc_bothDnsOptionsSet
--- PASS: TestAccAWSVpc_bothDnsOptionsSet (16.82s)
=== RUN   TestAccAWSVpc_DisabledDnsSupport
--- PASS: TestAccAWSVpc_DisabledDnsSupport (36.52s)
=== RUN   TestAccAWSVpc_classiclinkOptionSet
--- PASS: TestAccAWSVpc_classiclinkOptionSet (38.13s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	739.543s
```

* provider/aws: New Resource: aws_egress_only_internet_gateway

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEgressOnlyInternetGateway_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/09 14:22:16 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSEgressOnlyInternetGateway_ -timeout 120m
=== RUN   TestAccAWSEgressOnlyInternetGateway_basic
--- PASS: TestAccAWSEgressOnlyInternetGateway_basic (32.67s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	32.692s
```

* provider/aws: Add IPV6 support to aws_subnet

```
% make testacc TEST=./builtin/providers/aws
% TESTARGS='-run=TestAccAWSSubnet_'
% 1 ↵ ✹ ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/27 19:08:34 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSubnet_
-timeout 120m
=== RUN   TestAccAWSSubnet_importBasic
--- PASS: TestAccAWSSubnet_importBasic (69.88s)
=== RUN   TestAccAWSSubnet_basic
--- PASS: TestAccAWSSubnet_basic (51.28s)
=== RUN   TestAccAWSSubnet_ipv6
--- PASS: TestAccAWSSubnet_ipv6 (90.39s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws211.574s
```

* provider/aws: Add support for running aws_instances with ipv6 addresses
2017-03-01 16:16:59 +00:00
Paul Stack 546b424d7d provider/aws: Allow aws_instances to be resized rather than forcing a (#11998)
new instance

Fixes: #9157

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/16 15:13:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m
=== RUN   TestAccAWSInstance_changeInstanceType
--- PASS: TestAccAWSInstance_changeInstanceType (303.85s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	303.876s
```
2017-02-16 16:43:09 +02:00
Timon Wong 80afc6759b provider/aws: Add "no_device" support to ephemeral block devices (#10547)
Fixes #8455, #5390

This add a new `no_device` attribute to `ephemeral_block_device` block,
which allows users omit ephemeral devices from AMI's predefined block
device mappings, which is useful for EBS-only instance types.
2016-12-08 11:03:51 +01: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
Modestas Vainius 7385fa9eac provider/aws: Support refresh of EC2 instance user_data.
Make sure to hash base64 decoded value since user_data might be given
either raw bytes or base64 value.

This helps https://github.com/hashicorp/terraform/issues/1887 somewhat
as now you can:

1) Update user_data in AWS console.
2) Respectively update user_data in terraform code.
3) Just refresh terraform state and it should not report any changes.
2016-10-12 15:19:25 -05:00
Brian Menges 17b16f543e Ignore IOPS on non io1 AWS devices (#7783)
- Already ignoring IOPS on ebs attached non-io1 devices; extended to root_block_device
- Added warning captured from #4146 / [../blob/master/builtin/providers/aws/resource_aws_ebs_volume.go#L104](resource_aws_ebs_volume.go#L104)
- Added test when setting IOPS to 330 (11GiB * 30 = 330) on GP2 root device results in AWS reported 100 IOPS (successfully ignored input)
2016-07-25 12:32:24 +01:00
clint shryock 5add35d654 provider/aws: Add Tags to Test AMIs to help debug leaks 2016-06-01 09:09:41 -05:00
Mitchell Hashimoto d85df63526
providers/aws: aws_instance id-only 2016-04-22 09:37:41 -07:00
clint shryock 2830558bc9 check resource data for base64 encoded string 2016-04-13 10:44:26 -05:00
Doug Neal 1c662c2bc4 [#4794] Don't Base64-encode EC2 userdata if it is already Base64 encoded (#6140)
* Don't Base64-encode EC2 userdata if it is already Base64 encoded

The user data may be Base64 encoded already - for example, if it has been
generated by a template_cloudinit_config resource.

* Add encoded user_data to aws_instance acceptance test
2016-04-13 10:20:20 -05:00
clint shryock 02ba1bf2d4 provider/aws: More Acc test updates
Working on the green

- randomize some Autoscaling lifecycle hook test names
- use vpc_security_group_ids for this test
2016-03-10 14:33:54 -06:00
Paul Hinze 4af2c5f5dd core: fix diff mismatch when RequiresNew field and list both change
fixes #1752

Includes AccTest reproducing example from the issue as well as a bunch
of explanatory comments in the tests and impls.
2016-01-19 15:38:04 -06:00
Paul Hinze c8319d3b72 provider/aws: fix CheckDestroy on aws_instance tests 2015-12-22 08:49:50 -06:00
clint shryock 4a5847f9ea providers/aws: Vet aws 2015-12-01 10:00:35 -06:00
Clint Shryock efa26ed2a7 provider/aws: Fix issue with disabling source dest check on first run 2015-10-01 17:00:30 -05:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
Clint Shryock 579ccbefea provider/aws: Update source to comply with upstream breaking change 2015-07-28 15:29:46 -05:00
Mitchell Hashimoto 0b3d249727 provider/aws: ignore providers with Meta nil
We changed the way validation works for providers so that they aren't
always configured if they have computed attributes. The result is that
sometimes the Configure won't be called, hence Meta is nil
2015-06-30 10:24:53 -07:00
Paul Hinze 020dc03234 provider/aws: fix root_block_device for odd AMIs
Some AMIs have a RootDeviceName like "/dev/sda1" that does not appear as a
DeviceName in the BlockDeviceMapping list (which will instead have
    something like "/dev/sda")

While this seems like it breaks an invariant of AMIs, it ends up working
on the AWS side, and AMIs like this are common enough that we need to
special case it so Terraform does the right thing.

Our heuristic is: if the RootDeviceName does not appear in the
BlockDeviceMapping, assume that the DeviceName of the first
BlockDeviceMapping entry serves as the root device.

fixes #2224
2015-06-23 09:01:41 -05:00
Clint Shryock 9885ac8689 provider/aws: Fix issue with associating KeyPairs with Instances 2015-06-10 14:02:26 -05:00
Paul Hinze 66c51d44f6 aws/provider convert _normal tests to _basic
For consistency!
2015-06-07 18:04:38 -05:00
Clint Shryock fcd89828f9 provider/aws: Correctly default Instance source_dest_check to true 2015-06-03 15:54:01 -05:00
Paul Hinze b71fa3d0ae provider/aws: handle upstream aws-sdk-go repo move
`awslabs/aws-sdk-go => aws/aws-sdk-go`

Congrats to upstream on the promotion. :)
2015-06-03 13:36:57 -05:00
Paul Hinze 31258e06c6 provider/aws: fix breakages from awserr refactor
This landed in aws-sdk-go yesterday, breaking the AWS provider in many places:

3c259c9586

Here, with much sedding, grepping, and manual massaging, we attempt to
catch Terraform up to the new `awserr.Error` interface world.
2015-05-20 06:21:23 -05:00
Paul Hinze e1ea427649 provider/aws: support ec2 termination protection
closes #1233
2015-05-15 15:20:58 -04:00
Clint Shryock f7b6b6b2b5 Strip 'sdk' suffix from methods; it's a remnant 2015-05-12 14:58:10 -05:00
Paul Hinze 010a39a58e provider/aws: remove placement_group from acctest
Depends on there being an existing placement group in the account called
"terraform-placement-group" - we'll need to circle back around to cover
this with AccTests after TF gets an `aws_placement_group` resource.
2015-05-06 10:13:24 -05:00
Clint Shryock 036d199dd6 provider/aws: Fix issue with updating VPC Security Group IDs for an Instance
Currently, we weren't correctly setting the ids, and are setting both
`security_groups` and `vpc_security_group_ids`. As a result, we really only use
the former.

We also don't actually update the latter in the `update` method.

This PR fixes both issues, correctly reading `security_groups` vs.
`vpc_security_group_ids` and allows users to update the latter without
destroying the Instance when in a VPC.
2015-04-29 10:03:57 -05:00
Mitchell Hashimoto 57af67b314 Merge pull request #1718 from ravenac95/encrypted-ebs-volume-fix
provider/aws: Fix connecting encrypted ebs volumes to aws_instances
2015-04-28 20:21:12 -07:00
Reuven V. Gonzales e8e42decc9 Added docs about m3.medium to tests 2015-04-28 15:19:31 -07:00
Reuven V. Gonzales 25ab54b4e3 Added tests to check for encrypted flag 2015-04-28 15:07:23 -07:00
Mitchell Hashimoto b755459ee3 Merge pull request #1358 from rzh/placement_group
provider/aws: support for AWS Placement Group
2015-04-22 08:20:43 +02:00
Matt Good 21b0a03d70 Support for multiple providers of the same type
Adds an "alias" field to the provider which allows creating multiple instances
of a provider under different names. This provides support for configurations
such as multiple AWS providers for different regions. In each resource, the
provider can be set with the "provider" field.

(thanks to Cisco Cloud for their support)
2015-04-20 14:14:34 -07:00
Clint Shryock ba43b7c963 mass search-replace of ec2SDKconn 2015-04-16 15:05:55 -05:00
Clint Shryock a5b2437dcf provider/aws: Convert Instance to use upstream library 2015-04-16 12:01:10 -05:00
Clint Shryock 3337503eda update test and documentation for vpc ids in instances 2015-04-15 12:17:21 -05:00
Paul Hinze 1118a86798 providers/aws: make acc test name match pattern 2015-04-09 12:33:20 -05:00
Paul Hinze 34c7bbcf4d providers/aws: reduce scope of block_device set hashcodes
Fixes #1409

Resource set hash calculation is a bit of a devil's bargain when it
comes to optional, computed attributes.

If you omit the optional, computed attribute from the hash function,
changing it in an existing config is not properly detected.

If you include the optional, computed attribute in the hash and do not
specify a value for it in the config, then you'll end up with a
perpetual, unresolvable diff.

We'll need to think about how to get the best of both worlds, here, but
for now I'm switching us to the latter and documenting the fact that
changing these attributes requires manual `terraform taint` to apply.
2015-04-09 08:53:09 -05:00
Rui Zhang 94bb3ed513 Support for AWS Placement Group
- add placement_group for aws instance
- update test and document
2015-04-01 23:33:16 -07:00
Paul Hinze a4e80b6313 providers/aws: derive instance root_block_device name
I was working on building a validation to check the user-provided
"device_name" for "root_block_device" on AWS Instances, when I realized
that if I can check it, I might as well just derive it automatically!

So that's what we do here - when you customize the details of the root
block device, device name is just comes from the selected AMI.
2015-03-23 11:58:45 -05:00
Paul Hinze 6c62e23829 providers/aws: fix bug w/ empty block dev mapping
fixes #1249
2015-03-19 13:14:31 -05:00
Paul Hinze f990c3b02b providers/aws: fix blockdevices acceptance test
hashcodes just needed updating from latest hash func tweaks
2015-03-19 11:40:48 -05:00
Paul Hinze 2b23c402ee providers/aws: rework instance block devices
Instance block devices are now managed by three distinct sub-resources:

 * `root_block_device` - introduced previously
 * `ebs_block_device` - all additional ebs-backed volumes
 * `ephemeral_block_device` - instance store / ephemeral devices

The AWS API support around BlockDeviceMapping is pretty confusing. It's
a single collection type that supports these three members each of which
has different fields and different behavior.

My biggest hiccup came from the fact that Instance Store volumes do not
show up in any response BlockDeviceMapping for any EC2 `Describe*` API
calls. They're only available from the instance meta-data service as
queried from inside the node.

This removes `block_device` altogether for a clean break from old
configs. New configs will need to sort their `block_device`
declarations into the three new types. The field has been marked
`Removed` to indicate this to users.

With the new block device format being introduced, we need to ensure
Terraform is able to properly read statefiles written in the old format.
So we use the new `helper/schema` facility of "state migrations" to
transform statefiles in the old format to something that the current
version of the schema can use.

Fixes #858
2015-03-19 09:03:41 -05:00
Paul Hinze ca6f6a1e14 providers/aws: fix TestAccAWSInstance_normal
The test just needed updated SHAs for user_data.
2015-03-18 08:57:41 -05:00
Clint dc4abb48fa Merge pull request #1195 from hashicorp/f-retire-goamz
provider/aws: Retire goamz
2015-03-16 08:42:40 -05:00
Clint Shryock 670d22e18f update acceptance test with the correct depends_on declarations 2015-03-13 14:58:05 -05:00
Clint Shryock 14a4ea65ea Merge branch 'master' into b-aws-instance-sec-groups
* master:
  provider/aws: Fix encoding bug with AWS Instance
  minor style cleanups
  Tags Schema
  Added Tagging
  Added vpc refactor in aws sdk go
  Removed additional variable for print, added for debugging
  Using hashicorp/aws-sdk-go
  Changed things around as suggested by @catsby
  Refactor with Acceptance Tests
  VPC Refactor
  First refactor
  Added Connection to config
2015-03-13 14:39:29 -05:00
Clint Shryock d5f23aec0a provider/aws: Fix encoding bug with AWS Instance 2015-03-13 10:54:00 -05:00