Reputation: 103
I feel I have tried just about every combination for this to work, and have come up empty handed. Has anyone done this? I am trying to reference an import value inside of a sub while referencing the the parameter ApiStack. Appreciate any advice!
LambdaPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt MyLambdaFunction.Arn
Principal: apigateway.amazonaws.com
SourceArn: !Sub
- arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${ApiGateway}/*/POST/CreateBofAParameter
- ApiGateway: !ImportValue
'Fn::Sub': '${ApiStack}--APIID'
Upvotes: 7
Views: 3202
Reputation: 354
The same to used in the question code structure worked for me, thus, as mentioned in the comments, the issue is not related to Sub / ImportValue precedence or format.
Arn: !Sub
- "arn:aws:elasticfilesystem:${AWS::Region}:${AWS::AccountId}:access-point/${VariableToImport}"
- VariableToImport: !ImportValue
'Fn::Sub': "${SubVariable}-some-id"
Upvotes: 2