【发布时间】:2021-03-11 13:09:36
【问题描述】:
我想从另一个堆栈引用我的实例配置文件值。
如果实例配置文件资源在模板中,我可以 !Ref Name of the resource
---
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
SSMInstanceProfileStack:
Description: instance profile stack
Type: String
Default: instance-profile
Resources:
Ec2:
Type: AWS::EC2::Instance
Properties:
InstanceType: t2.micro
ImageId: ami-077a5b1762a2dde35
IamInstanceProfile:
- Fn::ImportValue:
Fn::Sub: "${SSMInstanceProfileStack}-Suffix"
Tags:
- Key: Name
Value: Ec2SandPit
Outputs:
Ec2Output:
Description: A bare bone Ec2 instance
Value: !Ref Ec2
Export:
Name: !Sub "${AWS::StackName}-Ec2"
我收到此错误,资源已部署。
Value of property IamInstanceProfile must be of type String
有解决办法吗?
【问题讨论】:
标签: amazon-web-services cloud amazon-cloudformation