2 回答
TA贡献1853条经验 获得超18个赞
我无法复制您的错误。以下合成和部署没有错误,正确检索certArn参数ssm作为有效的证书 arn 查找输入:
func NewCertLookupStack(scope constructs.Construct, id string, props *awscdk.StackProps) awscdk.Stack {
stack := awscdk.NewStack(scope, &id, &props)
certArn := awsssm.StringParameter_ValueFromLookup(stack, jsii.String("/dummy/certarn"))
certificate := awscertificatemanager.Certificate_FromCertificateArn(stack, jsii.String("Certificate"), certArn)
awscdk.NewCfnOutput(stack, jsii.String("ArnOutput"), &awscdk.CfnOutputProps{
Value: certificate.CertificateArn(), // demonstrate it works: the correct cert arn storeed as a stack output
})
return stack
}
TA贡献1772条经验 获得超5个赞
我通过在我的代码中将证书的 UUID 设置为变量,然后手动构建 ARN 来解决这个问题。不过,这感觉像是解决问题的错误方法。
createdArn := jsii.String(fmt.Sprintf("arn:aws:acm:us-east-1:%s:certificate/%s", *sprops.Env.Account, certUuid)) certificate := awscertificatemanager.Certificate_FromCertificateArn(stack, wrapName("certificate"), createdArn)
- 2 回答
- 0 关注
- 103 浏览
添加回答
举报