How to reference a shared ssm parameter(ram based) with Cloudformation

0

Based on the new SSM Advanced Parameter Cross Account Sharing https://aws.amazon.com/about-aws/whats-new/2024/02/aws-systems-manager-parameter-store-cross-account-sharing/ and https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types I need to use the RAM ARN of the shared SSM Parameter

As is mentioned in the documentation

For SSM parameters shared by another AWS account, enter the full parameter ARN. For more information about Systems Manager parameters, see Systems Manager Parameter Store and Working with shared parameters in the AWS Systems Manager User Guide.

I couldn't find an example on how to reference it in Cloudformation

I tried

AWS::SSM::Parameter::Name
Default: <The SSM Shared ARN>

질문됨 2달 전440회 조회
1개 답변
0

For SSM parameters shared by another AWS account, enter the full parameter ARN.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types

for example:

Resources:
  MyEC2Instance:
    Type: 'AWS::EC2::Instance'
    Properties:
      # Other EC2 properties...
      UserData:
        Fn::Base64:
          Fn::Sub: |
            #!/bin/bash
            echo "${MyParameter}"
Parameters:
  MyParameter:
    Description: SSM parameter value
    Type: 'AWS::SSM::Parameter::Value<String>'
    Default: 'arn:aws:ssm:REGION:SOURCE_ACCOUNT_ID:parameter/PARAMETER_NAME'
profile picture
전문가
답변함 2달 전
  • I tried the suggested approach but I am getting an error

    An error ocurred (Internal Failure) when calling the CreateChangeSet operation (reached max retries: 2) Unknown
    

    I did upgrade the AWS CLI to version 2.15. Also I was able to run aws ssm get-parameter --name <remote-parameter-arn> from the target account without any issues..

  • after running cfn-lint -t mytemplate.yml I got the following response

    W2506 Parameter LatestAmiId should be of type [AWS::EC2::Image::Id, AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>]
    

    Tried the approach and got the same results.

  • can you provide a full CF Template ?

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

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

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

관련 콘텐츠