Commit Graph

17 Commits

Author SHA1 Message Date
yn 8ea5d53954 SNS Topic Subscription: import more attributes (#10408) 2017-01-30 11:52:23 +00:00
Ninir 99be2d3280 provider/aws: Improved the SNS topic subscription protocols validation 2016-12-13 17:54:52 +01:00
Paul Stack e81751c4ee provider/aws: Support Import `aws_sns_topic_subscription` (#7359)
Had to change the way that the tests were working to include a random sqs-queue name due to this error:

```

`aws_sqs_queue.test_queue: Error creating SQS queue: AWS.SimpleQueueService.QueueDeletedRecently: You must wait 60 seconds after deleting a queue before you can create another with the same name.
			status code: 400, request id: b58e800a-ae27-556e-b6de-cfe1bbf9dc09``

```
make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSNSTopicSubscription_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSNSTopicSubscription_ -timeout 120m
=== RUN   TestAccAWSSNSTopicSubscription_importBasic
--- PASS: TestAccAWSSNSTopicSubscription_importBasic (24.44s)
=== RUN   TestAccAWSSNSTopicSubscription_basic
--- PASS: TestAccAWSSNSTopicSubscription_basic (25.26s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	49.722s
```
2016-06-27 08:44:05 -05:00
Paul Stack 61b5176fbe provider/aws: Updating state when `aws_sns_topic_subscription` is (#6629)
missing

Fixes #6625

When an SNS topic subscription was created with TF and then removed via
the AWS Console, Terraform threw an error:

```
* aws_sns_topic_subscription.testme: NotFound: Subscription does not
* exist
    status code: 404, request id: a22e7ed7-3630-5a8a-b767-317ac1440e24
```

This PR will remove the topic subscription from state on a NotFound and
will then readd the subscripton
2016-05-12 13:46:22 +01:00
Paul Hinze 108ccf0007 builtin: Refactor resource.Retry to clarify return
Change the `RetryFunc` from a plain `error` return type to a
specialized `RetryError` which must decide whether it is
retryable or not.

Add `RetryableError` / `NonRetryableError` factory functions that
callers are meant to use to build up these errors.

This makes it eminently clear whether or not a given error is
retryable from inside the client code.

Goal here is to _not_ change any behavior, simply reflect the
existing behavior with the new, clearer, API.
2016-03-09 17:37:56 -06:00
Paul Hinze 893bfb3ff4 provider/aws: Fix int overflow on 386 builds
386 architecture builds were failing with:

```
builtin/providers/aws/resource_aws_sns_topic_subscription.go:216: constant 60000000000 overflows int
```
2016-02-24 13:55:01 -06:00
Srikalyan Swayampakula 345dbce77a Made the necessary changes to ensure the variable name represents right value. 2016-02-13 12:15:29 -08:00
Srikalyan Swayampakula f21dc995c5 Update code based on the review suggestions.
1. Used resource.Retry instead of custom solution
2. Removed unnecessary variables and added required variable to resource.Retry.
2016-02-12 12:21:52 -08:00
Srikalyan Swayampakula 3d256dd021 Found an issue with more testing aws api is responding with various of
"pending confirmation" such as "PendingConfirmation", "Pending Confirmation" etc.
2016-01-18 15:38:34 -08:00
Srikalyan Swayampakula 63d6d8dbe2 Forgot to add one last condition to ensure that non pending confirmation subscription is returned. 2016-01-18 14:00:11 -08:00
Srikalyan Swayampakula 9d125944c0 Added support for http/https endpoints that auto confirms SNS topic subscription.
http and https SNS topic subscription endpoints require confirmation to set a valid arn otherwise
arn would be set to "pending confirmation". If the endpoints auto confirm then arn is set
asynchronously but if we try to create another subscription with same parameters then api returns
"pending subscription" as arn but does not create another a duplicate subscription. In order to
solve this we should be fetching the subscription list for the topic and identify the subscription
with same parameters i.e., protocol, topic_arn, endpoint and extract the subscription arn.

Following changes were made to support the http/https endpoints that auto confirms

1. Added 3 extra parameters i.e.,
   1. endpoint_auto_confirms -> boolean indicates if end points auto confirms
   2. max_fetch_retries -> number of times to fetch subscription list for the topic to get the subscription arn
   3. fetch_retry_delay -> delay b/w fetch subscription list call as the confirmation is done asynchronously.

  With these parameters help added support http and https protocol based endpoints that auto confirm.

2. Update website doc appropriately
2016-01-17 12:24:32 -08:00
clint shryock ac60d6b959 provider/aws: Limit SNS Topic Subscription protocols
- update the ARN with the new ID
2016-01-12 09:57:09 -06:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -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
Clint Shryock de141fe1cc provider/aws: Updates to SNS / SQS resources after upstream change 2015-06-03 08:46:03 -05:00
John Ewart 1dd95df5ab Export ARN in SQS queue and SNS topic / subscription; updated tests for new AWS SDK errors; updated documentation. 2015-05-22 21:12:25 -07:00
John Ewart 68734517f8 Initial SNS support 2015-05-22 20:26:10 -07:00