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: Allow disabled access_log in ELB #11120

Merged
merged 2 commits into from
Jan 9, 2017
Merged

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Jan 9, 2017

Fixes #10138

The AWS API does not let you "delete" access_logs from an ELB. Currently we simply mark the access logs as disabled and move on, however that prevented users from creating and tracking ELBs with disabled access logs... disabled access_logs were not being persisted to state.

Here we persist access_logs blocks to state if they are found in the configuration, or if they are not in the configuration and the API reports an enabled access_logs configuration.

TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSELB_ -timeout 120m
=== RUN   TestAccAWSELB_importBasic
--- PASS: TestAccAWSELB_importBasic (18.28s)
=== RUN   TestAccAWSELB_basic
--- PASS: TestAccAWSELB_basic (21.69s)
=== RUN   TestAccAWSELB_fullCharacterRange
--- PASS: TestAccAWSELB_fullCharacterRange (17.47s)
=== RUN   TestAccAWSELB_AccessLogs_enabled
--- PASS: TestAccAWSELB_AccessLogs_enabled (51.73s)
~~> === RUN   TestAccAWSELB_AccessLogs_disabled          <~~
~~> --- PASS: TestAccAWSELB_AccessLogs_disabled (51.06s) <~~
=== RUN   TestAccAWSELB_generatedName
--- PASS: TestAccAWSELB_generatedName (18.09s)
=== RUN   TestAccAWSELB_availabilityZones
--- PASS: TestAccAWSELB_availabilityZones (33.63s)
=== RUN   TestAccAWSELB_tags
--- PASS: TestAccAWSELB_tags (28.92s)
=== RUN   TestAccAWSELB_iam_server_cert
--- PASS: TestAccAWSELB_iam_server_cert (32.72s)
=== RUN   TestAccAWSELB_swap_subnets
--- PASS: TestAccAWSELB_swap_subnets (63.05s)
=== RUN   TestAccAWSELB_InstanceAttaching
--- PASS: TestAccAWSELB_InstanceAttaching (117.06s)
=== RUN   TestAccAWSELB_HealthCheck
--- PASS: TestAccAWSELB_HealthCheck (18.14s)
=== RUN   TestAccAWSELB_Timeout
--- PASS: TestAccAWSELB_Timeout (19.47s)
=== RUN   TestAccAWSELB_ConnectionDraining
--- PASS: TestAccAWSELB_ConnectionDraining (16.50s)
=== RUN   TestAccAWSELB_SecurityGroups
--- PASS: TestAccAWSELB_SecurityGroups (37.99s)

Save any explicitly disabled access_log to state. Do not save disabled
access_logs if they are not in the configuration.
@stack72
Copy link
Contributor

stack72 commented Jan 9, 2017

This LGTM! Thanks for this :) Tests pass as expected

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSELB_'                                                                   ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/09 23:00:09 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSELB_ -timeout 120m
=== RUN   TestAccAWSELB_importBasic
--- PASS: TestAccAWSELB_importBasic (41.97s)
=== RUN   TestAccAWSELB_basic
--- PASS: TestAccAWSELB_basic (48.77s)
=== RUN   TestAccAWSELB_fullCharacterRange
--- PASS: TestAccAWSELB_fullCharacterRange (36.69s)
=== RUN   TestAccAWSELB_AccessLogs_enabled
--- PASS: TestAccAWSELB_AccessLogs_enabled (133.42s)
=== RUN   TestAccAWSELB_AccessLogs_disabled
--- PASS: TestAccAWSELB_AccessLogs_disabled (136.00s)
=== RUN   TestAccAWSELB_generatedName
--- PASS: TestAccAWSELB_generatedName (39.94s)
=== RUN   TestAccAWSELB_availabilityZones
--- PASS: TestAccAWSELB_availabilityZones (65.73s)
=== RUN   TestAccAWSELB_tags
--- PASS: TestAccAWSELB_tags (72.77s)

@stack72 stack72 merged commit c0d0f71 into master Jan 9, 2017
@stack72 stack72 deleted the b-aws-elb-access-logs branch January 9, 2017 23:11
@ghost
Copy link

ghost commented Apr 18, 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 18, 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_elb access_logs Continuously Recreated
2 participants