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 json format for CloudFormation import resource id generation #367

Open
reidca opened this issue May 29, 2024 · 0 comments
Open

Support json format for CloudFormation import resource id generation #367

reidca opened this issue May 29, 2024 · 0 comments

Comments

@reidca
Copy link

reidca commented May 29, 2024

When choosing the import option then downloading the template, former2 generates the template yaml file and above this file it adds the resource ids in the following format (using AWS Organizations OUs and Accounts as examples):

# Import properties for OrganizationsOrganizationalUnit (AWS::Organizations::OrganizationalUnit)
# 
#     Id: ou-xxxxxxxxx
# 
# Import properties for OrganizationsAccount (AWS::Organizations::Account)
# 
#     AccountId: 123456789012
# 

While useful for visual confirmation, this format is not useful when importing the resources into CloudFormation which expects a json format like this:

{
        "LogicalResourceId": "OrganizationsOrganizationalUnit",
        "ResourceType": "AWS::Organizations::OrganizationalUnit",
        "ResourceIdentifier": {
            "Id": "ou-xxxxxxxxx"
        }
    }

and

{
        "LogicalResourceId": "OrganizationsAccount",
        "ResourceType": "AWS::Organizations::Account",
        "ResourceIdentifier": {
            "AccountId": "123456789012"
        }
    },

Can former2 be changed to generate the correct json format needed by CloudFormation? This would save a lot of time and effort having to manually convert the comment format ids into the json format needed.

Thanks

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

1 participant