Commit Graph

41 Commits

Author SHA1 Message Date
Kannan Goundan e1455350b8 aws_route53_record: More consistent unquoting of TXT/SPF records. (#14170)
* aws_route53_record: More consistent unquoting of TXT/SPF records.

Before, 'flatten' would remove the first two quotes.  This results in
confusing behavior if the value contained two quoted strings.

Now, 'flatten' we only remove the surrounding qutoes, which is more
consistent with 'expand'.

Should improve hashicorp/terraform#8423, but more could still be done.

* aws/route53: Cover new bugfix with an acceptance test
2017-05-05 11:41:53 +02:00
Johannes Würbach ef0196f754
provider/aws: Make the type of a route53_record changeable
Utilize the ChangeResourceRecordSets to change the type of a record by
deleting and recreating with a new type.

As change batches are considered transactional changes, Amazon Route 53
either makes all or none of the changes in the batch request ensuring the
update will never be partially applied.
2017-01-12 13:13:35 +01:00
stack72 0c80b4d172
provider/aws: Wait for `aws_route_53_record` to be in-sync after a
delete

Fixes #6679

When we change the type of a record, it forces a new resource. We never
waited for the recordset to be in-sync after a deletion.

```
% 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/09/03 17:55:03 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 (85.54s)
=== RUN   TestAccAWSRoute53Record_basic_fqdn
--- PASS: TestAccAWSRoute53Record_basic_fqdn (101.75s)
=== RUN   TestAccAWSRoute53Record_txtSupport
--- PASS: TestAccAWSRoute53Record_txtSupport (84.01s)
=== RUN   TestAccAWSRoute53Record_spfSupport
--- PASS: TestAccAWSRoute53Record_spfSupport (85.08s)
=== RUN   TestAccAWSRoute53Record_generatesSuffix
--- PASS: TestAccAWSRoute53Record_generatesSuffix (97.12s)
=== RUN   TestAccAWSRoute53Record_wildcard
--- PASS: TestAccAWSRoute53Record_wildcard (141.08s)
=== RUN   TestAccAWSRoute53Record_failover
--- PASS: TestAccAWSRoute53Record_failover (91.25s)
=== RUN   TestAccAWSRoute53Record_weighted_basic
--- PASS: TestAccAWSRoute53Record_weighted_basic (89.01s)
=== RUN   TestAccAWSRoute53Record_alias
--- PASS: TestAccAWSRoute53Record_alias (88.91s)
=== RUN   TestAccAWSRoute53Record_s3_alias
--- PASS: TestAccAWSRoute53Record_s3_alias (103.10s)
=== RUN   TestAccAWSRoute53Record_weighted_alias
--- PASS: TestAccAWSRoute53Record_weighted_alias (174.71s)
=== RUN   TestAccAWSRoute53Record_geolocation_basic
--- PASS: TestAccAWSRoute53Record_geolocation_basic (89.50s)
=== RUN   TestAccAWSRoute53Record_latency_basic
--- PASS: TestAccAWSRoute53Record_latency_basic (89.12s)
=== RUN   TestAccAWSRoute53Record_TypeChange
--- PASS: TestAccAWSRoute53Record_TypeChange (138.09s)
=== RUN   TestAccAWSRoute53Record_empty
--- PASS: TestAccAWSRoute53Record_empty (88.51s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1684.774s
```
2016-09-03 19:17:05 +03:00
stack72 8a72bfa5a9
provider/aws: Fix the Destroy func in the Route53 record tests
The test didn't expand the record name - therefore, when the name was
empty, it wasn't setting it to the domain name (like the normal resource
does!) This was causing an error
2016-07-18 13:25:42 +01:00
macheins aabb200f2d
Allow empty names in aws_route53_record
Added test for aws_route53_record with empty name

Integrated test for aws_route53_record with empty name

Changed test to use a third-level domain for zone
2016-07-18 13:25:38 +01:00
Paul Stack d0fc1fa086 provider/aws: Randomize the ELB name in an AWS route53 acceptance test (#7341)
FYI @catsby

The acceptance test was throwing the error:

```
* aws_elb.main: DuplicateLoadBalancerName: Load Balancer named
* foobar-terraform-elb already exists and it is configured with
* different parameters.
```

So randomized the name and the test still passes as expected:

```
make testacc TEST=./builtin/providers/aws
TESTARGS='-run=TestAccAWSRoute53Record_alias'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRoute53Record_alias -timeout 120m
=== RUN   TestAccAWSRoute53Record_alias
--- PASS: TestAccAWSRoute53Record_alias (97.70s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    97.722s
```
2016-06-27 08:52:12 -05:00
clint shryock d89a240885 - minor wording update and link to docs
- fix error checking
- update debug log on migration
- remove regression test because the attribute is renamed
2016-05-31 16:32:37 -05:00
Adam Mielke 97fbeaf59f add support for geolocation and latency records to aws route53 provider 2016-05-31 15:11:02 -05:00
clint shryock 42ee519a31 provider/aws: Update Route53 Record to schema v1, normalizing name
The `name` attribute will always be normalized to a FQDN, with a trailing "dot"
at the end when returned from the API.

We store the name as it's provided in the configuration, so "www" stays as "www"
and "www.terraformtesting.io." stays as "www.terraformtesting.io.".

The problem here is that if we use a full name as above, and the configuraiton
does *not* include the trailing dot, the API will return a version that does,
and we'll have a conflict.

This is particularly bad when we have a lifecycle block with
`create_before_destroy`; the record will get an update posted (which ends up
being a no-op on AWS's side), but then we'll delete the same record immediately
after, resulting in no record at all.

This PR addresses that by trimming the trailing dot from the `name` when saving
to state. We migrate existing state to match, to avoid false-positive diffs.
2016-05-10 11:17:02 -05:00
Mitchell Hashimoto 2274bb8c4a
provider/aws: route53 record import 2016-04-21 13:50:03 -07:00
clint shryock 53a42eaa0f provider/aws: Add a regression test for Route53 records
This is a follow up on #4892 with tests that demonstrate creating a record and a zone, then destroying said record, and confirming that a new plan is generated, using the ExpectNonEmptyPlan flag

This simulates the bug reported in #4641 by mimicking the state file that one would have if they created a record with Terraform v0.6.6, which is to say a weight = 0 for a default value.

When upgrading, there would be an expected plan change to get that to -1. To mimic the statefile we apply the record and then in a follow up step change the attributes directly. We then try to delete the record.

I tested this by grabbing the source of aws_resource_route53.go from Terraform v0.6.9 and running the included test, which fails. The test will pass with #4892 , because we no longer reconstruct what the record should be based on the state (instead finding via the API and elimination/matching)
2016-02-03 09:16:50 -06:00
clint shryock 363defb548 provider/aws: Update Route53 Zone tests 2015-12-22 14:58:43 -06:00
stack72 a556c98cde Adding support for the escapaing of Route53 SPF records 2015-11-30 12:14:39 +00:00
clint shryock fd251e8b45 rename TestAccAWSRoute53Record_weighted to TestAccAWSRoute53Record_weighted_basic to test in isolation 2015-11-18 16:08:23 -06:00
Luke Amdor 10ca0559ae provider/aws: no weight for all set_identifier 2015-11-12 16:15:05 -06:00
clint shryock 953f38c534 lowercase everything in r53 names 2015-10-20 16:36:25 -05:00
Anthony Stanton 44f2d85de8 Add acceptance test
=== RUN   TestAccAWSRoute53Record_weighted
--- PASS: TestAccAWSRoute53Record_weighted (249.19s)
2015-09-17 17:20:12 +02:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
John Engelman cbe9be4571 Add website_domain for S3 buckets. 2015-07-22 10:38:28 -05:00
Clint Shryock 3688d4ba00 provider/aws: Converge on TestAccAWS for acceptance tests names
An attempt to converge the tests into a standard naming scheme

- TestAccAWS for aws tests
- a `_basic` test for each suite, save a few that are quick (Network ACLs, for
  example)
2015-07-21 09:42:02 -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
Mitchell Hashimoto 37c56d0084 provider/aws: fix alias test 2015-05-06 09:55:14 -07:00
Clint Shryock 34609c6c22 provider/aws: Change Route 53 record test name, so it can be ran individually 2015-05-06 09:48:15 -05:00
Clint Shryock 81422123e8 provider/aws: Add a regression check for Route 53 records 2015-05-04 17:05:49 -05:00
Radek Simko 3d665ddfcf provider/aws: Add support for alias record to Route53 2015-05-01 22:43:04 +01:00
Radek Simko 555f9dfab3 aws: Support for weighted Route53 records added
- closes #1155
2015-04-17 18:53:36 +01:00
Clint Shryock 1da9bc8f4c fix go formatting after rebase 2015-04-16 13:42:16 -05:00
Clint Shryock 1545dbb803 provider/aws: Convert Route 53 Zone, Record to upstream 2015-04-16 13:41:38 -05:00
Clint Shryock 547080002c provider/aws: Fix issue with Route 53 and pre-existing, external Hosted Zones 2015-04-07 15:20:56 -05:00
Clint Shryock 32eebf4e15 provider/aws: Cleanup Route 53 subdomain name handling 2015-03-23 15:01:53 -05:00
Clint Shryock a8c80a447e Merge branch 'b-fix-route53-txt-records'
* b-fix-route53-txt-records:
  provider/aws: Fix issue with Route53 and TXT records
  provider/aws: Add test for TXT route53 record
2015-03-19 15:47:20 -05:00
Clint Shryock 49e6c8fd87 provider/aws: Fix wildcard support in Route53 record
Fixes a bug in Route53 and wildcard entries. Refs #501.
Also fixes:
- an issue in the library where we don't fully wait for the results, because the
  error code/condition changed with the migration to aws-sdk-go
- a limitation in the test, where we only consider the first record returned
2015-03-17 14:57:45 -05:00
Clint Shryock f4808b1ea7 provider/aws: Add test for TXT route53 record 2015-03-16 15:28:45 -05:00
Clint Shryock f3ba181861 Swap awslabs/aws-sdk-go for hashicorp fork
A temporary change to prevent upstream break while awslabs continues to
refactor.
2015-02-25 15:29:11 -06:00
Clint Shryock 94e7723370 provider/aws: Convert Route 53 Zone resource to use new awslabs/aws-sdk-go
library.

This commit updates the Route 53 Zone resource to use AWS Labs aws-sdk-go
library instead of mitchellh/goamz.

- hard code us-east-1 for Route53 region, since it's a global endpoint
- add some units test for CleanZoneID
2015-02-19 15:05:46 -06:00
Clint Shryock 90c8317899 Auto add full domain suffix if not present 2015-02-11 16:39:25 -08:00
Sander van Harmelen eccd5ad308 Refactored about 90%
Still need to update 2 resources and check the acceptance tests, but
overall we’re nearly there 😃
2014-11-21 17:58:34 +01:00
Mitchell Hashimoto c5d6df692d providers/aws: tests passing, compiles 2014-09-16 17:49:24 -07:00
Mitchell Hashimoto 623c635fb1 providers/aws: can create records with multiple values [GH-221] 2014-08-22 17:19:39 -07:00
Mitchell Hashimoto c886148e15 providers/aws: use example.com for tests 2014-08-22 12:51:19 -07:00
Armon Dadgar b6503a7810 provider/aws: Adding route53 records support 2014-07-22 23:08:41 -04:00