gpt-4o-mini-2024-07-18· openai
from WildChat-4.8M
how to create SSM parameter for aws via cli commands
- User
how to create SSM parameter for aws via cli commands
- Assistant
To create an SSM (AWS Systems Manager) Parameter using AWS CLI, you will need to use the
aws ssm put-parametercommand. Below are the steps and an example command to help you create a parameter.Prerequisites:
- AWS CLI Installed: Make sure you have the AWS CLI installed and configured with the appropriate permissions.
- IAM Permissions: Your IAM user or role needs the necessary permissions to create SSM parameters (e.g.,
ssm:PutParameter).
Command to Create an SSM Parameter:
The basic syntax for the command is:
bashaws ssm put-parameter --name "parameter-name" --value "parameter-value" --type "parameter-type"Parameter Types:
String: A standard string parameter.StringList: A comma-separated list of strings.SecureString: A secure string parameter that can be used to store sensitive information (you can enable AWS KMS encryption for this).
Example Command:
Here is an example of how to create a String parameter:
bashaws ssm put-parameter --name "/my/app/parameter1" --value "myValue" --type "String" --overwrite--name: The name of the parameter (useing a naming convention, such as a path).--value: The value you want to store in the parameter.--type: The type of the parameter. In this case, it's aString.--overwrite: Optional flag to overwrite an existing parameter with the same name.
Creating a SecureString Parameter:
If you want to create a
SecureStringparameter, you could do it like this:bashaws ssm put-parameter --name "/my/app/secure-parameter" --value "mySecureValue" --type "SecureString" --key-id "alias/aws/ssm" --overwrite--key-id: (Optional) The KMS key to use for encryption. You can specify the default KMS key for SSM withalias/aws/ssmor your custom key.
Additional Options: