Merge pull request #12540 from rifelpet/sqs-arn

Don't hard-code the SQS Queue ARN partition
This commit is contained in:
Kubernetes Prow Robot 2021-10-15 10:32:54 -07:00 committed by GitHub
commit 3568bf6e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View File

@ -140,9 +140,10 @@ func (b *NodeTerminationHandlerBuilder) buildSQSQueue(c *fi.ModelBuilderContext)
func (b *NodeTerminationHandlerBuilder) buildEventBridgeRules(c *fi.ModelBuilderContext) error {
clusterName := b.ClusterName()
queueName := model.QueueNamePrefix(clusterName) + "-nth"
partition := b.AWSPartition
region := b.Region
accountID := b.AWSAccountID
targetArn := "arn:aws:sqs:" + region + ":" + accountID + ":" + queueName
targetArn := "arn:" + partition + ":sqs:" + region + ":" + accountID + ":" + queueName
clusterNamePrefix := awsup.GetClusterName40(clusterName)
for _, event := range events {

View File

@ -984,7 +984,7 @@
"Targets": [
{
"Id": "1",
"Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
"Arn": "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
}
]
}
@ -1004,7 +1004,7 @@
"Targets": [
{
"Id": "1",
"Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
"Arn": "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
}
]
}
@ -1024,7 +1024,7 @@
"Targets": [
{
"Id": "1",
"Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
"Arn": "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
}
]
}
@ -1044,7 +1044,7 @@
"Targets": [
{
"Id": "1",
"Arn": "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
"Arn": "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
}
]
}

View File

@ -265,22 +265,22 @@ resource "aws_cloudwatch_event_rule" "nthsqsresources-longclustername-e-fkbaoh-S
}
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-ASGLifecycle-Target" {
arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
arn = "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-ASGLifecycle.id
}
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-InstanceStateChange-Target" {
arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
arn = "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-InstanceStateChange.id
}
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-RebalanceRecommendation-Target" {
arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
arn = "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-RebalanceRecommendation.id
}
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-SpotInterruption-Target" {
arn = "arn:aws:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
arn = "arn:aws-test:sqs:us-test-1:123456789012:nthsqsresources-longclustername-example-com-nth"
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-SpotInterruption.id
}