{"id":34905844,"url":"https://github.com/alistanis/cf_parameter_generator","last_synced_at":"2025-12-26T10:01:03.774Z","repository":{"id":57622503,"uuid":"81992627","full_name":"alistanis/cf_parameter_generator","owner":"alistanis","description":"Do you need to write a ton of CloudFormation? Is it annoying to have to type ParameterKey and ParameterValue a million times and copying the Parameter names into a parameters file? Well, now you don't have to.","archived":false,"fork":false,"pushed_at":"2017-02-27T17:01:30.000Z","size":37,"stargazers_count":21,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T01:50:26.416Z","etag":null,"topics":["aws","cloud","cloudformation","devops","formation","golang","parameter"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alistanis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T21:49:49.000Z","updated_at":"2021-10-22T14:05:37.000Z","dependencies_parsed_at":"2022-09-26T20:10:42.370Z","dependency_job_id":null,"html_url":"https://github.com/alistanis/cf_parameter_generator","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/alistanis/cf_parameter_generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alistanis%2Fcf_parameter_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alistanis%2Fcf_parameter_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alistanis%2Fcf_parameter_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alistanis%2Fcf_parameter_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alistanis","download_url":"https://codeload.github.com/alistanis/cf_parameter_generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alistanis%2Fcf_parameter_generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28052416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloud","cloudformation","devops","formation","golang","parameter"],"created_at":"2025-12-26T10:00:36.259Z","updated_at":"2025-12-26T10:01:03.762Z","avatar_url":"https://github.com/alistanis.png","language":"Go","readme":"# cf_parameter_generator\nDo you need to write a ton of CloudFormation? Is it annoying to have to type ParameterKey and ParameterValue a million times and copying the Parameter names into a parameters file? Well, now you don't have to.\n\nGet it: `go get -u github.com/alistanis/cf_parameter_generator ./...`\n\n## Examples\n\nUsage\n\n    cf_parameter_generator --help\n    Usage of cf_parameter_generator:\n      -f string\n        \tThe file to read from to generate parameters.\n      -inyaml\n        \tWill expect input as yaml instead of json.\n      -min\n        \tIf given, will generate minified output.\n      -o string\n        \tOptional: Specify a file name to write out parameters.\n      -outyaml\n        \tWill output in yaml instead of json.\n      -overwrite\n        \tBy default, will update an existing parameters file with newly found parameters, but will not overwrite.\n      -r\tRemoves old entries from parameters found in old parameters files.\n      -spaces int\n        \tThe number of spaces used to indent the file if not generating minified output. (default 2)\n      -v\tPlaces verbose output in the ParameterValue field to be replaced.\n      -version\n        \tPrint the version and exits.\n\nPrinting output to command line:\n\n\n    $ cf_parameter_generator -f test.json\n\n```json\n      [\n        {\n          \"ParameterKey\": \"AccessControl\",\n          \"ParameterValue\": \"Type: String\"\n        },\n        {\n          \"ParameterKey\": \"ApplicationName\",\n          \"ParameterValue\": \"Type: String\"\n        },\n        {\n          \"ParameterKey\": \"AssetID\",\n          \"ParameterValue\": \"Type: String\"\n        },\n        {\n          \"ParameterKey\": \"Environment\",\n          \"ParameterValue\": \"Type: String\"\n        },\n        {\n          \"ParameterKey\": \"LifecycleConfigurationStatus\",\n          \"ParameterValue\": \"Type: String\"\n        },\n        {\n          \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n          \"ParameterValue\": \"Type: Number\"\n        },\n        {\n          \"ParameterKey\": \"SubnetIDs\",\n          \"ParameterValue\": \"Type: List\u003cAWS::EC2::Subnet::Id\u003e\"\n        },\n        {\n          \"ParameterKey\": \"VersioningConfigurationStatus\",\n          \"ParameterValue\": \"Type: String\"\n        }\n      ]\n```      \n      \nAccept input over stdin:\n\n      $ cat test.json | cf_parameter_generator\n      \n```json\n        [\n          {\n            \"ParameterKey\": \"AccessControl\",\n            \"ParameterValue\": \"Type: String\"\n          },\n          {\n            \"ParameterKey\": \"ApplicationName\",\n            \"ParameterValue\": \"Type: String\"\n          },\n          {\n            \"ParameterKey\": \"AssetID\",\n            \"ParameterValue\": \"Type: String\"\n          },\n          {\n            \"ParameterKey\": \"Environment\",\n            \"ParameterValue\": \"Type: String\"\n          },\n          {\n            \"ParameterKey\": \"LifecycleConfigurationStatus\",\n            \"ParameterValue\": \"Type: String\"\n          },\n          {\n            \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n            \"ParameterValue\": \"Type: Number\"\n          },\n          {\n            \"ParameterKey\": \"SubnetIDs\",\n            \"ParameterValue\": \"Type: List\u003cAWS::EC2::Subnet::Id\u003e\"\n          },\n          {\n            \"ParameterKey\": \"VersioningConfigurationStatus\",\n            \"ParameterValue\": \"Type: String\"\n          }\n        ]\n```\nSaving output to a new file (will update an existing file or overwrite it if it is blank (0 bytes))\n\n    $ cf_parameter_generator -f test.json -o params.json\n    \nContents of file:\n\n```json\n    [\n      {\n        \"ParameterKey\": \"AccessControl\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"ApplicationName\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"AssetID\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"Environment\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"LifecycleConfigurationStatus\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n        \"ParameterValue\": \"Type: Number\"\n      },\n      {\n        \"ParameterKey\": \"SubnetIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Subnet::Id\u003e\"\n      },\n      {\n        \"ParameterKey\": \"VersioningConfigurationStatus\",\n        \"ParameterValue\": \"Type: String\"\n      }\n    ]\n```\n\nEdit contents of file with real parameters:\n\n```json\n    [\n      {\n        \"ParameterKey\": \"AccessControl\",\n        \"ParameterValue\": \"Private\"\n      },\n      {\n        \"ParameterKey\": \"ApplicationName\",\n        \"ParameterValue\": \"TestApp\"\n      },\n      {\n        \"ParameterKey\": \"AssetID\",\n        \"ParameterValue\": \"1\"\n      },\n      {\n        \"ParameterKey\": \"Environment\",\n        \"ParameterValue\": \"dev\"\n      },\n      {\n        \"ParameterKey\": \"LifecycleConfigurationStatus\",\n        \"ParameterValue\": \"Enabled\"\n      },\n      {\n        \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n        \"ParameterValue\": \"30\"\n      },\n      {\n        \"ParameterKey\": \"SubnetIDs\",\n        \"ParameterValue\": \"subnet-a3425f2,subnet-a34551f\"\n      },\n      {\n        \"ParameterKey\": \"VersioningConfigurationStatus\",\n        \"ParameterValue\": \"Enabled\"\n      }\n    ]\n```\n    \nAdd a new Parameter to a template called InstanceIDS and run cf_parameter_generator again:\n\n    $ cf_parameter_generator -f test.json -o params.json\n    \nNew File Contents:\n    \t\n```json\n    [\n      {\n        \"ParameterKey\": \"AccessControl\",\n        \"ParameterValue\": \"Private\"\n      },\n      {\n        \"ParameterKey\": \"ApplicationName\",\n        \"ParameterValue\": \"TestApp\"\n      },\n      {\n        \"ParameterKey\": \"AssetID\",\n        \"ParameterValue\": \"1\"\n      },\n      {\n        \"ParameterKey\": \"Environment\",\n        \"ParameterValue\": \"dev\"\n      },\n      {\n        \"ParameterKey\": \"InstanceIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Instance::Id\u003e\"\n      },\n      {\n        \"ParameterKey\": \"LifecycleConfigurationStatus\",\n        \"ParameterValue\": \"Enabled\"\n      },\n      {\n        \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n        \"ParameterValue\": \"30\"\n      },\n      {\n        \"ParameterKey\": \"SubnetIDs\",\n        \"ParameterValue\": \"subnet-a3425f2,subnet-a34551f\"\n      },\n      {\n        \"ParameterKey\": \"VersioningConfigurationStatus\",\n        \"ParameterValue\": \"Enabled\"\n      }\n    ]\n```\n\nOverwrite Parameters File:\n    \n    $ cf_parameter_generator -f test.json -o params.json -overwrite    \t\n\n```json\n    [\n      {\n        \"ParameterKey\": \"AccessControl\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"ApplicationName\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"AssetID\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"Environment\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"InstanceIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Instance::Id\u003e\"\n      },\n      {\n        \"ParameterKey\": \"LifecycleConfigurationStatus\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n        \"ParameterValue\": \"Type: Number\"\n      },\n      {\n        \"ParameterKey\": \"SubnetIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Subnet::Id\u003e\"\n      },\n      {\n        \"ParameterKey\": \"VersioningConfigurationStatus\",\n        \"ParameterValue\": \"Type: String\"\n      }\n    ]\n``` \n  \nRemove InstanceIDs from template and run again with -r:\n    \n    $ cf_parameter_generator -f test.json -o params.json -r\n      Removing value {InstanceIDs Type: List\u003cAWS::EC2::Instance::Id\u003e   [] \u003cnil\u003e }\n\nFile contents after removal:\n    \n```json\n    [\n      {\n        \"ParameterKey\": \"AccessControl\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"ApplicationName\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"AssetID\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"Environment\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"LifecycleConfigurationStatus\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n        \"ParameterValue\": \"Type: Number\"\n      },\n      {\n        \"ParameterKey\": \"SubnetIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Subnet::Id\u003e\"\n      },\n      {\n        \"ParameterKey\": \"VersioningConfigurationStatus\",\n        \"ParameterValue\": \"Type: String\"\n      }\n    ]  \n```\n    \nPrint Verbose Output:\n    \t\n    $ cf_parameter_generator -f test.json -v\n\n```json\n    [\n      {\n        \"ParameterKey\": \"AccessControl\",\n        \"ParameterValue\": \"Type: String, Default: Private, AllowedValues: [Private PublicRead PublicReadWrite AuthenticatedRead LogDeliveryWrite BucketOwnerRead BucketOwnerFullControl], Description: The ACL to apply to this S3 bucket.\"\n      },\n      {\n        \"ParameterKey\": \"ApplicationName\",\n        \"ParameterValue\": \"Type: String, Description: The name of this application\"\n      },\n      {\n        \"ParameterKey\": \"AssetID\",\n        \"ParameterValue\": \"Type: String, Description: The HUIT asset ID for this application\"\n      },\n      {\n        \"ParameterKey\": \"Environment\",\n        \"ParameterValue\": \"Type: String, Default: dev, AllowedValues: [dev test int stage prod prod1 prod2], Description: The deployment environment for this application\"\n      },\n      {\n        \"ParameterKey\": \"InstanceIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Instance::Id\u003e, Description: Instance IDs\"\n      },\n      {\n        \"ParameterKey\": \"LifecycleConfigurationStatus\",\n        \"ParameterValue\": \"Type: String, Default: Enabled, AllowedValues: [Enabled Disabled], Description: Enables or disables lifecycle configuration\"\n      },\n      {\n        \"ParameterKey\": \"NoncurrentVersionExpirationInDays\",\n        \"ParameterValue\": \"Type: Number, Default: 30, Description: For buckets with versioning enabled (or suspended), specifies the time, in days, between when a new version of the object is uploaded to the bucket and when old versions of the object expire. When object versions expire, Amazon S3 permanently deletes them. If you specify a transition and expiration time, the expiration time must be later than the transition time.\"\n      },\n      {\n        \"ParameterKey\": \"SubnetIDs\",\n        \"ParameterValue\": \"Type: List\u003cAWS::EC2::Subnet::Id\u003e, Description: Subnet IDs\"\n      },\n      {\n        \"ParameterKey\": \"VersioningConfigurationStatus\",\n        \"ParameterValue\": \"Type: String, Default: Enabled, AllowedValues: [Enabled Suspended], Description: Whether or not to enable versioning on this bucket\"\n      }\n    ]\t\n```\n    \nRead in yaml and output yaml:\n\n\n    $ cf_parameter_generator -f test.yaml -inyaml -outyaml\n\n```yaml\n      - parameterkey: AWSAccount\n        parametervalue: 'Type: String'\n      - parameterkey: AmazonEC2FullAccessARN\n        parametervalue: 'Type: String'\n      - parameterkey: AmazonRoute53FullAccessARN\n        parametervalue: 'Type: String'\n      - parameterkey: AppTierFleetSize\n        parametervalue: 'Type: Number'\n      - parameterkey: AppTierInstanceType\n        parametervalue: 'Type: String'\n```\n\nVerbose yaml:\n    \n    $ cf_parameter_generator -f test.yaml -inyaml -outyaml -v\n\n```yaml\n      - parameterkey: AWSAccount\n        parametervalue: 'Type: String, Default: admints-dev, AllowedValues: [admints-dev\n          admints], Description: Name of the AWS Account'\n      - parameterkey: AmazonEC2FullAccessARN\n        parametervalue: 'Type: String, Default: arn:aws:iam::aws:policy/AmazonEC2FullAccess,\n          Description: The ARN of a policy granting ''full access'' rights to EC2'\n      - parameterkey: AmazonRoute53FullAccessARN\n        parametervalue: 'Type: String, Default: arn:aws:iam::aws:policy/AmazonRoute53FullAccess,\n          Description: The ARN of a policy granting ''full access'' rights to Route53'\n      - parameterkey: AppTierFleetSize\n        parametervalue: 'Type: Number, Default: 3, AllowedValues: [3], Description: App\n          Tier Fleet Size'\n      - parameterkey: AppTierInstanceType\n        parametervalue: 'Type: String, Default: m4.large, AllowedValues: [t2.medium t2.large\n          m4.large m4.xlarge m4.2xlarge m4.4xlarge m4.8xlarge], Description: App tier instance\n          type.  NOTE: use t2.medium for stack testing only.'\n```\n         \nRead in json and output yaml:\n    \n    $ cf_parameter_generator -f test.json -outyaml\n\n```yaml\n      - parameterkey: AccessControl\n        parametervalue: 'Type: String'\n      - parameterkey: ApplicationName\n        parametervalue: 'Type: String'\n      - parameterkey: AssetID\n        parametervalue: 'Type: String'\n      - parameterkey: Environment\n        parametervalue: 'Type: String'\n      - parameterkey: InstanceIDs\n        parametervalue: 'Type: List\u003cAWS::EC2::Instance::Id\u003e'\n      - parameterkey: LifecycleConfigurationStatus\n        parametervalue: 'Type: String'\n      - parameterkey: NoncurrentVersionExpirationInDays\n        parametervalue: 'Type: Number'\n      - parameterkey: SubnetIDs\n        parametervalue: 'Type: List\u003cAWS::EC2::Subnet::Id\u003e'\n      - parameterkey: VersioningConfigurationStatus\n        parametervalue: 'Type: String'                    \n``` \n       \nRead in yaml and output json:\n        \n    $ cf_parameter_generator -inyaml -f test.yaml\n\n```json\n    [\n      {\n        \"ParameterKey\": \"AWSAccount\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"AmazonEC2FullAccessARN\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"AmazonRoute53FullAccessARN\",\n        \"ParameterValue\": \"Type: String\"\n      },\n      {\n        \"ParameterKey\": \"AppTierFleetSize\",\n        \"ParameterValue\": \"Type: Number\"\n      },\n      {\n        \"ParameterKey\": \"AppTierInstanceType\",\n        \"ParameterValue\": \"Type: String\"\n      }\n    ]\n```        ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falistanis%2Fcf_parameter_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falistanis%2Fcf_parameter_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falistanis%2Fcf_parameter_generator/lists"}