gpt4 book ai didi

aws-cloudformation - 用于执行 CloudFormation 更改集的直接 URL

转载 作者:行者123 更新时间:2023-12-03 07:43:01 27 4
gpt4 key购买 nike

在 AWS CloudFormation 中,我有一些更改集:

{
"eks-alb-ingress-private-security-groups": [
{
"StackId": "arn:aws:cloudformation:ap-southeast-2:111111111111:stack/eks-alb-ingress-private-security-groups/f452e940-3fe0-11ea-a91a-0a564743ac36",
"StackName": "eks-alb-ingress-private-security-groups",
"ChangeSetId": "arn:aws:cloudformation:ap-southeast-2:111111111111:changeSet/sceptre-change-set-eks-cluster-addons/2d497c25-2a02-4373-96c2-9f099076d264",
"ChangeSetName": "sceptre-change-set-eks-cluster-addons",
"ExecutionStatus": "AVAILABLE",
"Status": "CREATE_COMPLETE",
"CreationTime": "2020-03-17 08:05:53.943000+00:00"
}
]
}

解释得很好in the docs然后我如何执行该更改集。

但是,当应用许多更改集时,如果我可以在运行 aws cloudformation list-change-sets 后以某种方式生成用于执行更改的直接 URL,将会很方便。这会节省我很多点击时间!

我尝试从以下开始:

https://ap-southeast-2.console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/events?

然后URL编码,使用https://www.url-encode-decode.com :

encoded_stack_id=...
encoded_change_set_id=...

指向生成的 URL:

url="https://ap-southeast-2.console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/events?StackId=${encoded_stack_id}&ChangeSetId=${encoded_change_set_id}"

但这会导致发出此错误:

You must specify a Stack ID. Displaying your Stacks page.

The URL specified is invalid.
You must specify both a Stack ID and a Change Set ID. Displaying your Stacks page.

有可能做我想做的事吗?如果是这样,怎么办?

最佳答案

经过多次尝试和错误,我终于成功了:

首先,我安装了gridsite-clients:

apt-get install gridsite-clients

然后:

main_part="https://ap-southeast-2.console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/changesets/changes"

stack_id=$(urlencode \
"arn:aws:cloudformation:ap-southeast-2:111111111111:stack/eks-alb-ingress-private-security-groups/f452e940-3fe0-11ea-a91a-0a564743ac36")

change_set_id=$(urlencode \
"arn:aws:cloudformation:ap-southeast-2:111111111111:changeSet/sceptre-change-set-eks-cluster-addons/2d497c25-2a02-4373-96c2-9f099076d264")

url="$main_part?stackId=$stack_id&changeSetId=$change_set_id"

变量 $url 然后包含直接 URL,可将您带到 AWS 控制台中的更改设置执行页面。

关于aws-cloudformation - 用于执行 CloudFormation 更改集的直接 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60718827/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com