-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added ECR pull-through configuration #148
Conversation
variables.tf
Outdated
} | ||
|
||
variable "registry_credentials" { | ||
type = map(string) |
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.
Why don't you be more specific and inside the map use an object instead of random combination of string key value pairs?
I take it we'll always expect username
and accessToken
for registry_credentials
.
Therefore, it'd be in our best interest to use a defined object like so.
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.
For this particular registry, this could be considered an overkill, since it does not require any authentication at all.
Generally, yes, it's always username
and accessToken
, but there's discussion below with SimonG to have this hardcoded instead, for this particular registry...
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.
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.
If registry_credentials
variable is agreed upon, I would urge that you map an object to the proposed attributes in order to prevent the injection of any unexpected/harmful key-value pairs.
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.
Agreements can be re-agreed 😈
In any case, this was copied from upstream, I understand there is possibility for end user to inject unwanted kv pair(s), but what you propose is just a measure to prevent end-user shooting themselves in the foot (they should do it simply, c/p what is already there and put correct values).
Waiting for response from SimonG (below; it's connected to your input as well, because he wants it hard-coded).
779ed11
to
2d36fb0
Compare
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.
LGTM
@sgrdn could you also leave a review
cbe3c30
to
332ca4b
Compare
e3e5574
to
6e60312
Compare
As the title says, this will create ECR rule to set up pull-through cache in your private ECR registry.
It includes necessary credentals' secret, IAM policy and the pull-through rule itself.
The creation of resources is controlled through object variable.
Actual functionality from EKS cluster (ie IAM permissions, usage of images from upstream repository in cluster) is tested.
Terraform v1.9.4
on windows_amd64