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

r/flow_log: Add cross_account_iam_role_arn attribute #29254

Merged
merged 6 commits into from
Mar 8, 2023

Conversation

mattburgess
Copy link
Collaborator

@mattburgess mattburgess commented Feb 5, 2023

Description

Relations

Closes #28577.
Closes #29323.

References

Output from Acceptance Testing

$ make testacc ACCTEST_PARALLELISM=3 TESTS=TestAccVPCFlowLog_ PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3 -run='TestAccVPCFlowLog_'  -timeout 180m
=== RUN   TestAccVPCFlowLog_vpcID
=== PAUSE TestAccVPCFlowLog_vpcID
=== RUN   TestAccVPCFlowLog_logFormat
=== PAUSE TestAccVPCFlowLog_logFormat
=== RUN   TestAccVPCFlowLog_subnetID
=== PAUSE TestAccVPCFlowLog_subnetID
=== RUN   TestAccVPCFlowLog_crossAccountRole
=== PAUSE TestAccVPCFlowLog_crossAccountRole
=== RUN   TestAccVPCFlowLog_transitGatewayID
=== PAUSE TestAccVPCFlowLog_transitGatewayID
=== RUN   TestAccVPCFlowLog_transitGatewayAttachmentID
=== PAUSE TestAccVPCFlowLog_transitGatewayAttachmentID
=== RUN   TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs
=== PAUSE TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs
=== RUN   TestAccVPCFlowLog_LogDestinationType_kinesisFirehose
=== PAUSE TestAccVPCFlowLog_LogDestinationType_kinesisFirehose
=== RUN   TestAccVPCFlowLog_LogDestinationType_s3
=== PAUSE TestAccVPCFlowLog_LogDestinationType_s3
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3_invalid
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3_invalid
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour
=== RUN   TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval
=== PAUSE TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval
=== RUN   TestAccVPCFlowLog_tags
=== PAUSE TestAccVPCFlowLog_tags
=== RUN   TestAccVPCFlowLog_disappears
=== PAUSE TestAccVPCFlowLog_disappears
=== CONT  TestAccVPCFlowLog_vpcID
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3_invalid
=== CONT  TestAccVPCFlowLog_transitGatewayAttachmentID
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3_invalid (9.50s)
=== CONT  TestAccVPCFlowLog_crossAccountRole
--- PASS: TestAccVPCFlowLog_crossAccountRole (17.66s)
=== CONT  TestAccVPCFlowLog_transitGatewayID
--- PASS: TestAccVPCFlowLog_vpcID (30.51s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour (15.46s)
=== CONT  TestAccVPCFlowLog_disappears
--- PASS: TestAccVPCFlowLog_disappears (13.40s)
=== CONT  TestAccVPCFlowLog_tags
--- PASS: TestAccVPCFlowLog_tags (36.89s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval
--- PASS: TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval (15.70s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet (15.39s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible (14.86s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_kinesisFirehose
--- PASS: TestAccVPCFlowLog_transitGatewayID (172.61s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_s3
--- PASS: TestAccVPCFlowLog_LogDestinationType_s3 (14.54s)
=== CONT  TestAccVPCFlowLog_subnetID
--- PASS: TestAccVPCFlowLog_LogDestinationType_kinesisFirehose (82.57s)
=== CONT  TestAccVPCFlowLog_logFormat
--- PASS: TestAccVPCFlowLog_subnetID (15.78s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible (16.10s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs
--- PASS: TestAccVPCFlowLog_logFormat (28.68s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText
--- PASS: TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs (17.16s)
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText (16.75s)
--- PASS: TestAccVPCFlowLog_transitGatewayAttachmentID (281.25s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	281.350s

@github-actions
Copy link

github-actions bot commented Feb 5, 2023

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/M Managed by automation to categorize the size of a PR. service/vpc Issues and PRs that pertain to the vpc service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 5, 2023
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Feb 5, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccVPCFlowLog_' PKG=ec2 ACCTEST_PARALLELISM=3 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3  -run=TestAccVPCFlowLog_ -timeout 180m
=== RUN   TestAccVPCFlowLog_basic
=== PAUSE TestAccVPCFlowLog_basic
=== RUN   TestAccVPCFlowLog_logFormat
=== PAUSE TestAccVPCFlowLog_logFormat
=== RUN   TestAccVPCFlowLog_subnetID
=== PAUSE TestAccVPCFlowLog_subnetID
=== RUN   TestAccVPCFlowLog_transitGatewayID
=== PAUSE TestAccVPCFlowLog_transitGatewayID
=== RUN   TestAccVPCFlowLog_transitGatewayAttachmentID
=== PAUSE TestAccVPCFlowLog_transitGatewayAttachmentID
=== RUN   TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs
=== PAUSE TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs
=== RUN   TestAccVPCFlowLog_LogDestinationType_kinesisFirehose
=== PAUSE TestAccVPCFlowLog_LogDestinationType_kinesisFirehose
=== RUN   TestAccVPCFlowLog_LogDestinationType_s3
=== PAUSE TestAccVPCFlowLog_LogDestinationType_s3
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3_invalid
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3_invalid
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible
=== RUN   TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour
=== PAUSE TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour
=== RUN   TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval
=== PAUSE TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval
=== RUN   TestAccVPCFlowLog_tags
=== PAUSE TestAccVPCFlowLog_tags
=== RUN   TestAccVPCFlowLog_disappears
=== PAUSE TestAccVPCFlowLog_disappears
=== CONT  TestAccVPCFlowLog_basic
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour
--- PASS: TestAccVPCFlowLog_basic (26.24s)
=== CONT  TestAccVPCFlowLog_disappears
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText (27.20s)
=== CONT  TestAccVPCFlowLog_tags
=== CONT  TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour (27.61s)
--- PASS: TestAccVPCFlowLog_disappears (20.62s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs
--- PASS: TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval (23.81s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3_invalid
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3_invalid (13.68s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_s3
--- PASS: TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs (23.77s)
=== CONT  TestAccVPCFlowLog_LogDestinationType_kinesisFirehose
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible
--- PASS: TestAccVPCFlowLog_tags (55.89s)
--- PASS: TestAccVPCFlowLog_LogDestinationType_s3 (24.47s)
=== CONT  TestAccVPCFlowLog_transitGatewayID
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible (24.29s)
=== CONT  TestAccVPCFlowLog_transitGatewayAttachmentID
--- PASS: TestAccVPCFlowLog_LogDestinationType_kinesisFirehose (154.32s)
=== CONT  TestAccVPCFlowLog_subnetID
--- PASS: TestAccVPCFlowLog_transitGatewayID (157.71s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible
--- PASS: TestAccVPCFlowLog_subnetID (23.30s)
=== CONT  TestAccVPCFlowLog_logFormat
--- PASS: TestAccVPCFlowLog_logFormat (24.44s)
=== CONT  TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible (25.72s)
--- PASS: TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet (23.36s)
--- PASS: TestAccVPCFlowLog_transitGatewayAttachmentID (301.86s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	414.889s

@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Mar 8, 2023
@ewbankkit
Copy link
Contributor

ewbankkit commented Mar 8, 2023

@mattburgess Thanks for the contribution 🎉 👏.

I changed the new attribute name to deliver_cross_account_role to match the underlying AWS EC2 API.

@ewbankkit ewbankkit merged commit c3e4aaf into hashicorp:main Mar 8, 2023
@github-actions github-actions bot added this to the v4.58.0 milestone Mar 8, 2023
@github-actions
Copy link

This functionality has been released in v4.58.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@marcel-mattr
Copy link

@ewbankkit Why isn't this attribute called deliver_cross_account_role_arn instead of deliver_cross_account_role like iam_role_arn just to keep standards?

@marcel-mattr
Copy link

@mattburgess thank you so much for your contribution. You deserve a beer!

@mattburgess
Copy link
Collaborator Author

mattburgess commented Mar 18, 2023

@marcel-mattr as @ewbankkit mentioned above, the AWS Provider tries to align with the underlying AWS API whenever possible. As you'll see here, AWS ,for whatever reason, decided to call this new parameter DeliverCrossAccountRole. I agree with you that the naming isn't great, but it is what it is.

As to why, then, iam_role_arn isn't called deliver_logs_permission_arn to similarly match the underlying API I've no idea. Turns out consistency is hard? 😄

If it was up to me, the AWS API would have parameters called DeliverLogsIamRoleArn and DeliverLogsCrossAccountRoleArn but it's always easier to name things perfectly in hindsight.

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/vpc Issues and PRs that pertain to the vpc service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: AWS Flow Log + CloudWatch [Enhancement]: aws_flow_log attribute for Cross Account Role
3 participants