-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Fix missing default value in cloudfront_distribution's origin.origin_path #20709
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @kyontan 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
We have ran the acceptance tests and confirmed no regression found. |
@breathingdust Could you see this pr? Thanks. |
@ewbankkit @DrFaust92 Could you take a look for this pr? |
Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding. Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author. For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000. For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide. |
…tion Co-authored-by: int-tt <kattu0426@gmail.com>
I have followed the refactoring, and waiting for maintainer review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🎉
% make testacc TESTS=TestAccCloudFrontDistribution PKG=cloudfront
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/cloudfront/... -v -count 1 -parallel 20 -run='TestAccCloudFrontDistribution' -timeout 180m
--- PASS: TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValues_headers (202.36s)
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValuesCookies_whitelistedNames (204.63s)
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedSigners (204.70s)
--- PASS: TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValuesCookies_whitelistedNames (204.97s)
--- PASS: TestAccCloudFrontDistribution_ViewerCertificate_acmCertificateARN (224.22s)
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedKeyGroups (232.73s)
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehavior_realtimeLogARN (239.07s)
--- PASS: TestAccCloudFrontDistribution_OrderedCacheBehavior_realtimeLogARN (248.34s)
--- PASS: TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValues_headers (256.20s)
--- PASS: TestAccCloudFrontDistribution_ViewerCertificateACMCertificateARN_conflictsWithCloudFrontDefaultCertificate (268.27s)
--- PASS: TestAccCloudFrontDistribution_http11 (370.16s)
--- PASS: TestAccCloudFrontDistribution_isIPV6Enabled (371.68s)
--- PASS: TestAccCloudFrontDistribution_Origin_emptyDomainName (0.80s)
--- PASS: TestAccCloudFrontDistribution_Origin_emptyOriginID (0.78s)
--- PASS: TestAccCloudFrontDistribution_noCustomErrorResponse (384.29s)
--- PASS: TestAccCloudFrontDistribution_Origin_connectionAttempts (386.37s)
--- PASS: TestAccCloudFrontDistributionDataSource_basic (387.11s)
--- PASS: TestAccCloudFrontDistribution_retainOnDelete (389.10s)
--- PASS: TestAccCloudFrontDistribution_waitForDeployment (396.73s)
--- PASS: TestAccCloudFrontDistribution_orderedCacheBehaviorCachePolicy (487.60s)
--- PASS: TestAccCloudFrontDistribution_originGroups (497.02s)
--- PASS: TestAccCloudFrontDistribution_disappears (189.06s)
--- PASS: TestAccCloudFrontDistribution_enabled (560.13s)
--- PASS: TestAccCloudFrontDistribution_orderedCacheBehavior (355.57s)
--- PASS: TestAccCloudFrontDistribution_originPolicyOrdered (359.08s)
--- PASS: TestAccCloudFrontDistribution_noOptionalItems (337.64s)
--- PASS: TestAccCloudFrontDistribution_multiOrigin (366.12s)
--- PASS: TestAccCloudFrontDistribution_originPolicyDefault (372.31s)
--- PASS: TestAccCloudFrontDistribution_customOrigin (332.03s)
--- PASS: TestAccCloudFrontDistribution_Origin_originShield (450.51s)
--- PASS: TestAccCloudFrontDistribution_s3Origin (421.80s)
--- PASS: TestAccCloudFrontDistribution_Origin_connectionTimeout (414.74s)
--- PASS: TestAccCloudFrontDistribution_orderedCacheBehaviorResponseHeadersPolicy (358.96s)
--- PASS: TestAccCloudFrontDistribution_s3OriginWithTags (514.25s)
--- PASS: TestAccCloudFrontDistribution_forwardedValuesToCachePolicy (511.07s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront 886.647s
This functionality has been released in v4.8.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! |
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. |
The default value of
origin_path
parameter inorigin
block is blank string (""
), notnull
.It is known problem in #12065. The workaround is described in the issue.
Without this PR, modifing
aws_cloudfront_distrtibution
will crash and state get broken.It is apparently a bug in the provider and it should be handled by provider.
I have confirmed CLI (
aws cloudfront get-distribution
) returns blank string (""
) as default value if create resource without settingorigin_path
explicitly.According to the document, the default value is not noted though.
https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_Origin.html
This problem is work-arounded jmgreg31/terraform-aws-cloudfront#38.
Relates: #12065
Community Note
Output from acceptance testing: