Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alfred_ssm helper nested in lists #43

Closed
gdunkle opened this issue Nov 12, 2020 · 4 comments
Closed

Support alfred_ssm helper nested in lists #43

gdunkle opened this issue Nov 12, 2020 · 4 comments

Comments

@gdunkle
Copy link

gdunkle commented Nov 12, 2020

Provide support for alfred_ssm helper nested in lists

[{
                "ParameterKey": "Key",
                "ParameterValue":[
                        "$[alfred_ssm_/key1]",
                        "$[alfred_ssm_/key2]",
                        "$[alfred_ssm_/key3]"
                    ]
            }]
@groverlalit
Copy link
Member

Hello @gdunkle Thanks for opening this issue and pull request.
Can you please elaborate on the use case for this feature request? Thanks.

@gdunkle
Copy link
Author

gdunkle commented Dec 11, 2020

@groverlalit, I ran into this with a customer who wanted to share out multiple subnets via RAM. Currently they have to deploy the vpc then hardcode the subnet ids in a parameter file.

Template

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Share resources via RAM
Parameters:
    Name:
        Description: The name of the resource share.
        Type: String
    AllowExternalPrincipals:
        AllowedValues:
          - 'true'
          - 'false'
        Default: 'false'
        Description: Indicates whether principals outside your AWS organization can be associated with a resource share. 
        Type: String
    Principals:
        Description: The principals to associate with the resource share. The possible values are IDs of AWS accounts, the ARN of an OU or organization from AWS Organizations. 
        Type: CommaDelimitedList
    ResourceArns:
        Description: The Amazon Resource Names (ARN) of the resources to associate with the resource share.
        Type: CommaDelimitedList    
Resources:
    ResourceShare:
        Type: AWS::RAM::ResourceShare
        Properties: 
          AllowExternalPrincipals: !Ref AllowExternalPrincipals
          Name: !Ref Name
          Principals: !Ref Principals
          ResourceArns: !Ref ResourceArns

Parameters:

[
  {
    "ParameterKey": "Name",
    "ParameterValue": "ram-subnets-vpc-sandbox-us-east-2"
  },
  {
    "ParameterKey": "Principals",
    "ParameterValue": ["arn:aws:organizations::123456789012:ou/o-rlcvejgy5g/ou-0v3b-emvezkoj"]                                                                        
  },
  {
    "ParameterKey": "ResourceArns",
    "ParameterValue": ["$[alfred_ssm_/cfct/vpc-sandbox-01-us-east-2/PrivateSubnet1AARN]"
                      ,"$[alfred_ssm_/cfct/vpc-sandbox-01-us-east-2/PrivateSubnet2AARN]"
                      ,"$[alfred_ssm_/cfct/vpc-sandbox-01-us-east-2/PrivateSubnet3AARN]"
                      ,"$[alfred_ssm_/cfct/vpc-sandbox-01-us-east-2/PublicSubnet1ARN]"
                      ,"$[alfred_ssm_/cfct/vpc-sandbox-01-us-east-2/PublicSubnet2ARN]"
                      ,"$[alfred_ssm_/cfct/vpc-sandbox-01-us-east-2/PublicSubnet3ARN]"
    ]
  }
  
]

@groverlalit
Copy link
Member

Thanks for creating a pull request. We have added this our backlog.

@groverlalit
Copy link
Member

groverlalit commented May 19, 2021

This change was released in v2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants