Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 如何了解ALB_Amazon Web Services_Amazon Cloudformation_Aws Cdk - Fatal编程技术网

Amazon web services 如何了解ALB

Amazon web services 如何了解ALB,amazon-web-services,amazon-cloudformation,aws-cdk,Amazon Web Services,Amazon Cloudformation,Aws Cdk,我尝试在TypeScript中通过CDK创建alb。但在执行“cdk部署”时,我遇到了以下代码的错误。我怎样才能了解ALB AlbStack failed: Error [ValidationError]: Template error: resource alb does not support attribute type Arn in Fn::GetAtt 构造函数(作用域:cdk.Construct,id:string,props?:cdk.StackProps){ 超级(范围、id、

我尝试在TypeScript中通过CDK创建alb。但在执行“cdk部署”时,我遇到了以下代码的错误。我怎样才能了解ALB

AlbStack failed: Error [ValidationError]: Template error: resource alb does not support attribute type Arn in Fn::GetAtt
构造函数(作用域:cdk.Construct,id:string,props?:cdk.StackProps){
超级(范围、id、道具);
const target_group=new elbv2.cfn目标组(该“目标组”{
~
});
const alb=new elbv2.cfnloaddbalancer(此“alb”{
~
});
新elbv2.CfnListener(此“alblistener80”{
默认操作:xxx,

loadBalancerArn:cdk.Fn.getAtt(alb.logicalId,'Arn').toString(),//基于CloudFormation,
Ref
返回Arn,而不是getAtt。因此,如果要使用
cdk.Fn
,应该使用cdk的:

Ref内在函数返回指定参数或资源的值

因此,您可以尝试:

cdk.Fn.ref(alb.logicalId)

部署成功。谢谢!@HugoBang没问题。如果答案有帮助,我们将不胜感激。进展如何?获取ARN仍然存在问题?