mirror of https://github.com/kubernetes/kops.git
Merge pull request #12540 from rifelpet/sqs-arn
Don't hard-code the SQS Queue ARN partition
This commit is contained in:
commit
3568bf6e5f
|
@ -140,9 +140,10 @@ func (b *NodeTerminationHandlerBuilder) buildSQSQueue(c *fi.ModelBuilderContext)
|
||||||
func (b *NodeTerminationHandlerBuilder) buildEventBridgeRules(c *fi.ModelBuilderContext) error {
|
func (b *NodeTerminationHandlerBuilder) buildEventBridgeRules(c *fi.ModelBuilderContext) error {
|
||||||
clusterName := b.ClusterName()
|
clusterName := b.ClusterName()
|
||||||
queueName := model.QueueNamePrefix(clusterName) + "-nth"
|
queueName := model.QueueNamePrefix(clusterName) + "-nth"
|
||||||
|
partition := b.AWSPartition
|
||||||
region := b.Region
|
region := b.Region
|
||||||
accountID := b.AWSAccountID
|
accountID := b.AWSAccountID
|
||||||
targetArn := "arn:aws:sqs:" + region + ":" + accountID + ":" + queueName
|
targetArn := "arn:" + partition + ":sqs:" + region + ":" + accountID + ":" + queueName
|
||||||
|
|
||||||
clusterNamePrefix := awsup.GetClusterName40(clusterName)
|
clusterNamePrefix := awsup.GetClusterName40(clusterName)
|
||||||
for _, event := range events {
|
for _, event := range events {
|
||||||
|
|
|
@ -984,7 +984,7 @@
|
||||||
"Targets": [
|
"Targets": [
|
||||||
{
|
{
|
||||||
"Id": "1",
|
"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": [
|
"Targets": [
|
||||||
{
|
{
|
||||||
"Id": "1",
|
"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": [
|
"Targets": [
|
||||||
{
|
{
|
||||||
"Id": "1",
|
"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": [
|
"Targets": [
|
||||||
{
|
{
|
||||||
"Id": "1",
|
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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" {
|
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
|
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-ASGLifecycle.id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-InstanceStateChange-Target" {
|
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
|
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-InstanceStateChange.id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-RebalanceRecommendation-Target" {
|
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
|
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-RebalanceRecommendation.id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_cloudwatch_event_target" "nthsqsresources-longclustername-e-fkbaoh-SpotInterruption-Target" {
|
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
|
rule = aws_cloudwatch_event_rule.nthsqsresources-longclustername-e-fkbaoh-SpotInterruption.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue