Send dynamic parameters from Step Function to CloudFormation

0

Hi,

I am using CloudFormation create stack task in StepFunction as per screenshot. How can I pass AccountId to my template.

Enter image description here

Template:


Parameters:
  AccountId:
    Type: String

Resources:
  GitHubRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: 'Allow'
            Principal:
              Federated: !Sub arn:aws:iam::${AccountId}:oidc-provider/login.github.com
            Action: 'sts:AssumeRoleWithWebIdentity'

When I send this event in SF: { "AccountId": "12345678910" }

I got this error:

Parameters: [AccountId] must have values (Service: CloudFormation, Status Code: 400, Request ID: 2484b98c-fc47-4a4c-9e98-591485fd0ab8)

1 Risposta
2
Risposta accettata

You need to append .$ to the key name. E.g., "ParameterValue.$": "$.AccountId"

profile pictureAWS
ESPERTO
Uri
con risposta 3 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande