【发布时间】:2022-01-12 11:53:11
【问题描述】:
AWS 上有一个 VPC Basic cloudformation 模板可用。这是代码的链接:https://s3.us-west-2.amazonaws.com/cloudformation-templates-us-west-2/VPC_Single_Instance_In_Subnet.template
当我使用 CloudFormation 创建它时,它会失败,除非我使用 GUI 指定密钥对。当我指定密钥对时,它可以工作。
问题是,我正在尝试使用 AWS 的集成工具包从 AzureDevOps 运行此 cloudformation 模板。
目前,我这样做的方式是,我只是传递一个指向模板文件的链接。模板文件包含 JSON 格式的模板,但我不确定:
a) 我应该在上面链接的模板文件中插入密钥对名称
或
b) 其他方式?
我正在为 Azure DevOps 使用 AWS 工具包
这是我的代码:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: CloudFormationCreateOrUpdateStack
inputs:
awsCredentials: 'aws_test'
regionName: 'us-west-2'
stackName: 'test'
templateSource: 'url'
templateUrl: 'https://s3.us-west-2.amazonaws.com/cloudformation-templates-us-west-2/VPC_Single_Instance_In_Subnet.template'
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
我在运行时遇到的错误是参数KeyPair需要一个值。
【问题讨论】:
标签: amazon-web-services azure amazon-cloudformation devops