-
Notifications
You must be signed in to change notification settings - Fork 397
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
cloudfront_distribution doesn't recognise S3 origin #1819
Comments
This was referenced May 23, 2023
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Jun 22, 2023
Issue 1819 cloudfront distribution origin s3 domain SUMMARY Fixes #1819 As per Origin Domain Name spec now the S3 domain names are in the form {name}.s3.{region}.amazonaws.com, so the string fragment .s3.amazonaws.com no longer occurs in them, and therefore they aren't recognised as S3 origin domains. Consequentially, the origin is treated as a custom one, so a custom_origin_config member is generated into it, which collides with the s3_origin_config and produces an error: botocore.errorfactory.InvalidOrigin: An error occurred (InvalidOrigin) when calling the CreateDistribution operation: You must specify either a CustomOrigin or an S3Origin. You cannot specify both. The backward-compatible way is to recognise both {name}.s3.amazonaws.com and {name}.s3.{domain}.amazonaws.com, but for this a regular expression is the most effective solution. ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudfront_distribution ADDITIONAL INFORMATION The breakdown of the regex I used: \.s3(?:\.[^.]+)?\.amazonaws\.com$ \.s3 matches ".s3" \.[^.]+ would match a dot followed by at least one, possibly more non-dot characters (\.[^]+) would match the same, just grouped, so we could treat it as an atom (?:\.[^]+) would match the same, just grouped in a non-capturing fashion (we don't want to extract the matched characters) (?:\.[^]+)? matches the same, occuring 0 or 1 times \.amazonaws\.com matches ".amazonaws.com" $ matches the end of the input string Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis
patchback bot
pushed a commit
that referenced
this issue
Jun 22, 2023
Issue 1819 cloudfront distribution origin s3 domain SUMMARY Fixes #1819 As per Origin Domain Name spec now the S3 domain names are in the form {name}.s3.{region}.amazonaws.com, so the string fragment .s3.amazonaws.com no longer occurs in them, and therefore they aren't recognised as S3 origin domains. Consequentially, the origin is treated as a custom one, so a custom_origin_config member is generated into it, which collides with the s3_origin_config and produces an error: botocore.errorfactory.InvalidOrigin: An error occurred (InvalidOrigin) when calling the CreateDistribution operation: You must specify either a CustomOrigin or an S3Origin. You cannot specify both. The backward-compatible way is to recognise both {name}.s3.amazonaws.com and {name}.s3.{domain}.amazonaws.com, but for this a regular expression is the most effective solution. ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudfront_distribution ADDITIONAL INFORMATION The breakdown of the regex I used: \.s3(?:\.[^.]+)?\.amazonaws\.com$ \.s3 matches ".s3" \.[^.]+ would match a dot followed by at least one, possibly more non-dot characters (\.[^]+) would match the same, just grouped, so we could treat it as an atom (?:\.[^]+) would match the same, just grouped in a non-capturing fashion (we don't want to extract the matched characters) (?:\.[^]+)? matches the same, occuring 0 or 1 times \.amazonaws\.com matches ".amazonaws.com" $ matches the end of the input string Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis (cherry picked from commit 509ccad)
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Jul 2, 2023
…tion origin s3 domain (#1849) [PR #1821/509ccad9 backport][stable-6] Issue 1819 cloudfront distribution origin s3 domain This is a backport of PR #1821 as merged into main (509ccad). SUMMARY Fixes #1819 As per Origin Domain Name spec now the S3 domain names are in the form {name}.s3.{region}.amazonaws.com, so the string fragment .s3.amazonaws.com no longer occurs in them, and therefore they aren't recognised as S3 origin domains. Consequentially, the origin is treated as a custom one, so a custom_origin_config member is generated into it, which collides with the s3_origin_config and produces an error: botocore.errorfactory.InvalidOrigin: An error occurred (InvalidOrigin) when calling the CreateDistribution operation: You must specify either a CustomOrigin or an S3Origin. You cannot specify both. The backward-compatible way is to recognise both {name}.s3.amazonaws.com and {name}.s3.{domain}.amazonaws.com, but for this a regular expression is the most effective solution. ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudfront_distribution ADDITIONAL INFORMATION The breakdown of the regex I used: \.s3(?:\.[^.]+)?\.amazonaws\.com$ \.s3 matches ".s3" \.[^.]+ would match a dot followed by at least one, possibly more non-dot characters (\.[^]+) would match the same, just grouped, so we could treat it as an atom (?:\.[^]+) would match the same, just grouped in a non-capturing fashion (we don't want to extract the matched characters) (?:\.[^]+)? matches the same, occuring 0 or 1 times \.amazonaws\.com matches ".amazonaws.com" $ matches the end of the input string Reviewed-by: Mark Chappell
abikouo
pushed a commit
to abikouo/community.aws
that referenced
this issue
Oct 24, 2023
…_certificate and the corresponding _info module (ansible-collections#1819) Revert pull request ansible-collections#1805 that migrated iam_server_certificate and the corresponding _info module This reverts commit 978c802, reversing changes made to 06f8f53. SUMMARY ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: GomathiselviS Reviewed-by: Bikouo Aubin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
When I refer to an S3 bucket domain in the form
{bucket_name}.s3.{region}.amazonaws.com
, as per Origin Domain spec, it isn't recognised as an S3 domain here, so acustom_origin_config
entry is added automatically here, which results in an error:"botocore.errorfactory.InvalidOrigin: An error occurred (InvalidOrigin) when calling the CreateDistribution operation: You must specify either a CustomOrigin or an S3Origin. You cannot specify both."
The problem is in the method used for recognising S3 domains: whether it contains
.s3.amazonaws.com
or not (note the missing region part).Issue Type
Bug Report
Component Name
cloudfront_distribution
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
Steps to Reproduce
Expected Results
I expected that only the
s3_origin_config
is generated in the origin, and thecustom_origin_config
isn't.Actual Results
botocore.errorfactory.InvalidOrigin: An error occurred (InvalidOrigin) when calling the CreateDistribution operation: You must specify either a CustomOrigin or an S3Origin. You cannot specify both.
Code of Conduct
The text was updated successfully, but these errors were encountered: