Invalid resource attribute MytargetGroup for resource Outputs

0

I'm looking to get arn output of the target group. What is the correct way? I've tried the following and nothing works so far.

  ### Target group ###

  MyTargetGroup:
    Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
    Properties:
      HealthCheckEnabled: true
      HealthCheckIntervalSeconds: 30
      HealthCheckPath: /
      HealthCheckProtocol: HTTP
      HealthCheckTimeoutSeconds: 5
      HealthyThresholdCount: 5
      Matcher:
        HttpCode: "200,302"
      Name: target-group-1
      Protocol: HTTP
      Port: 80
      UnhealthyThresholdCount: 2
      VpcId: !ImportValue vpc-id

  #### Outputs ####
  
  Outputs:
    MyTargetGroupOutput:
      Value: !GetAtt MyTargetGroup.TargetGroupArn

Errors

cfn-lint

[cfn-lint] E3001: Invalid resource attribute MyTargetGroupOutput for resource Outputs

Cloudformation

An API call to CloudFormation.UpdateStackSet (RequestId: f1581762-6a59-41eb-802e-9927f849a7be) returned a ValidationError error: Invalid template resource property 'MyTargetGroupOutput' (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: bf04faf2-9dee-4874-9069-7a41a5b4d503; Proxy: null)

According to this document, it should work as I have above, but it doesn't.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html

질문됨 9달 전217회 조회
1개 답변
1
수락된 답변

Could it be an indentation problem? The Outputs section should be at the same level as the Resources section.

profile pictureAWS
전문가
kentrad
답변함 9달 전
profile pictureAWS
전문가
검토됨 9달 전
  • Thank you! It was the indentation. It's been a long week LOL.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠