Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Add aws_elasticsearch_domain_policy #8648

Merged
merged 1 commit into from
Feb 8, 2017

Conversation

radeksimko
Copy link
Member

Fixes #5067

FYI: The new acceptance test takes over 1 hour to finish and generally the approach 1) create domain 2) set policy requires roughly double the amount of time to apply/destroy because 1st we have to wait for creation of the domain and 2nd for policy. Any single change may take up to 1 hour. 😞

^ that also means it would be wise to tune our nightly acceptance test run in Travis, which may be hitting timeouts in the part dedicated to ES domain.

Test plan

make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSElasticSearchDomainPolicy'
TF_ACC=1 go test ./builtin/providers/aws -v -run=AWSElasticSearchDomainPolicy -timeout 120m
=== RUN   TestAccAWSElasticSearchDomainPolicy_basic
--- PASS: TestAccAWSElasticSearchDomainPolicy_basic (4425.25s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    4425.274s

@stack72 I left out the DiffSuppressFunc addition to aws_elasticsearch_domain. I think it can/should be addressed in a separate PR.

},
"access_policies": {
Type: schema.TypeString,
StateFunc: normalizeJson,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe we need the StateFunc now with the DiffSuppressFunc :)

@stack72
Copy link
Contributor

stack72 commented Sep 4, 2016

Hi @radeksimko

A few small points here but apart from that I think this is in good shape :)

P.

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Sep 4, 2016
@radeksimko
Copy link
Member Author

Re normalizeJson - I removed it, it's not bringing much benefit other that some saved bytes in tfstate due to minification.

PR ready for final review.

@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Sep 4, 2016
@stack72
Copy link
Contributor

stack72 commented Sep 5, 2016

Unfortunately the tests don't work here :(

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=AWSElasticSearchDomainPolicy'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/05 10:12:36 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=AWSElasticSearchDomainPolicy -timeout 120m
=== RUN   TestAccAWSElasticSearchDomainPolicy_basic
--- FAIL: TestAccAWSElasticSearchDomainPolicy_basic (4839.28s)
           testing.go:265: Step 0 error: Check failed: Check 3/3 error: aws_elasticsearch_domain_policy.main: Attribute 'access_policies' didn't match "^{\"Statement\":.+", got "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"es:*\",\"Resource\":\"arn:aws:es:us-west-2:187416307283:domain/tf-test-4972927438829555332\",\"Condition\":{\"IpAddress\":{\"aws:SourceIp\":\"127.0.0.1/32\"}}}]}"
FAIL
exit status 1
FAIL       github.com/hashicorp/terraform/builtin/providers/aws       4839.304s
make: *** [testacc] Error 1

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Sep 5, 2016
@radeksimko radeksimko force-pushed the f-aws-esd-policy branch 5 times, most recently from 3461645 to 50d3ebb Compare February 8, 2017 11:01
@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Feb 8, 2017
@radeksimko
Copy link
Member Author

Tests fixed - ready for review now.

@stack72
Copy link
Contributor

stack72 commented Feb 8, 2017

This is awesome @radeksimko :) Very happy to see this get added

LGTM!

@radeksimko radeksimko merged commit c25579a into hashicorp:master Feb 8, 2017
@radeksimko radeksimko deleted the f-aws-esd-policy branch February 8, 2017 13:21
@ghost
Copy link

ghost commented Apr 17, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_elasticsearch_domain keeps reapplying
2 participants