-
Notifications
You must be signed in to change notification settings - Fork 608
Simplify aws policy by adding cortex prefix to queue name #1941
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
Conversation
@@ -77,7 +77,7 @@ _NOTE: The policy created during `cortex cluster up` will automatically be delet | |||
{ | |||
"Effect": "Allow", | |||
"Action": "sqs:*", | |||
"Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:{{ .SQSPrefix }}*" | |||
"Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:cortex-*" |
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.
nit: convert to const
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.
What do you mean here?
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.
The cortex- prefix
@@ -53,7 +53,7 @@ var _cortexPolicy = ` | |||
{ | |||
"Effect": "Allow", | |||
"Action": "sqs:*", | |||
"Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:{{ .SQSPrefix }}*" | |||
"Resource": "arn:aws:sqs:{{ .Region }}:{{ .AccountID }}:cortex-*" |
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.
nit: convert to const
// 10 was chosen to make sure that other identifiers can be added to the full queue name before reaching the 80 char SQS name limit | ||
return hash.String(clusterName)[:10] + "-" | ||
// 8 was chosen to make sure that other identifiers can be added to the full queue name before reaching the 80 char SQS name limit | ||
return "cortex-" + hash.String(clusterName)[:8] + "-" |
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.
nit: convert to const
# Conflicts: # cli/cmd/cluster.go
checklist:
make test
andmake lint