|
1 | 1 | # AWS SSM Parameter Store |
2 | 2 |
|
3 | | -*Documentation coming soon* |
| 3 | +AWS Systems Manager Parameter Store is a powerful, cost-effective solution for storing configuration data and secrets. It provides secure, hierarchical storage for configuration data management and secrets management. |
4 | 4 |
|
5 | | -This page will cover the AWS SSM vault driver, including: |
| 5 | +## Why Choose SSM Parameter Store? |
6 | 6 |
|
7 | | -- Parameter Store integration |
8 | | -- Configuration and setup |
9 | | -- Security and encryption |
10 | | -- Cost considerations |
| 7 | +**Cost-Effective**: Standard parameters are free (up to 10,000), with Advanced parameters costing only $0.05 per 10,000 API interactions. |
| 8 | + |
| 9 | +**Hierarchical Organization**: Natural path-based organization (`/myapp/production/DB_PASSWORD`) that aligns perfectly with Keep's namespace system. |
| 10 | + |
| 11 | +**Encryption Built-In**: Native integration with AWS KMS for transparent encryption of sensitive values. |
| 12 | + |
| 13 | +**Fine-Grained Access Control**: Leverage AWS IAM for precise control over who can access which parameters in which environments. |
| 14 | + |
| 15 | +**Version History**: Automatic versioning of parameter changes with built-in rollback capabilities. |
| 16 | + |
| 17 | +**Cross-Service Integration**: Native integration with EC2, ECS, Lambda, and other AWS services. |
| 18 | + |
| 19 | +## Adding an SSM Vault |
| 20 | + |
| 21 | +Use the `vault:add` command to configure a new SSM vault: |
| 22 | + |
| 23 | +```bash |
| 24 | +keep vault:add |
| 25 | +``` |
| 26 | + |
| 27 | +You'll be prompted for: |
| 28 | + |
| 29 | +**Driver**: Select "AWS Systems Manager Parameter Store" from the available vaults |
| 30 | + |
| 31 | +**Slug**: A friendly slug for this vault (e.g., `myapp-ssm`) that will be used in template placeholders |
| 32 | + |
| 33 | +**Friendly Name**: A reference name for the vault (e.g., `MyApp SSM Vault`) |
| 34 | + |
| 35 | +**AWS Region**: The AWS region where your parameters will be stored (e.g., `us-east-1`) |
| 36 | + |
| 37 | +**Parameter Prefix**: Optional base path for all parameters. If you specify `myapp`, your parameters will be stored as `/myapp/[namespace]/[stage]/[key]` |
| 38 | + |
| 39 | +**KMS Key ID**: Optional. Leave empty to use AWS managed key (`alias/aws/ssm`), or specify a custom KMS key for additional security |
| 40 | + |
| 41 | +## IAM Permission Scenarios |
| 42 | + |
| 43 | +Let's look at how to set up IAM permissions for different roles in your organization when using AWS SSM Parameter Store with Keep. These examples assume a namespace of "myapp" and use the default KMS key for SSM. |
| 44 | + |
| 45 | +### Full Developer Access |
| 46 | + |
| 47 | +For developers who need complete access to manage secrets across all environments in `myapp`: |
| 48 | + |
| 49 | +```json |
| 50 | +{ |
| 51 | + "Version": "2012-10-17", |
| 52 | + "Statement": [ |
| 53 | + { |
| 54 | + "Effect": "Allow", |
| 55 | + "Action": [ |
| 56 | + "ssm:GetParameter", |
| 57 | + "ssm:GetParameters", |
| 58 | + "ssm:GetParametersByPath", |
| 59 | + "ssm:GetParameterHistory", |
| 60 | + "ssm:PutParameter", |
| 61 | + "ssm:DeleteParameter", |
| 62 | + "ssm:LabelParameterVersion", |
| 63 | + "ssm:UnlabelParameterVersion" |
| 64 | + ], |
| 65 | + "Resource": "arn:aws:ssm:*:*:parameter/myapp/*" |
| 66 | + }, |
| 67 | + { |
| 68 | + "Effect": "Allow", |
| 69 | + "Action": [ |
| 70 | + "kms:Decrypt", |
| 71 | + "kms:Encrypt", |
| 72 | + "kms:GenerateDataKey" |
| 73 | + ], |
| 74 | + "Resource": [ |
| 75 | + "arn:aws:kms:*:*:alias/aws/ssm" |
| 76 | + ] |
| 77 | + } |
| 78 | + ] |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +### Environment-Specific Developer Access |
| 83 | + |
| 84 | +For developers who should only access development and staging environments: |
| 85 | + |
| 86 | +```json |
| 87 | +{ |
| 88 | + "Version": "2012-10-17", |
| 89 | + "Statement": [ |
| 90 | + { |
| 91 | + "Effect": "Allow", |
| 92 | + "Action": [ |
| 93 | + "ssm:GetParameter", |
| 94 | + "ssm:GetParameters", |
| 95 | + "ssm:GetParametersByPath", |
| 96 | + "ssm:PutParameter", |
| 97 | + "ssm:DeleteParameter", |
| 98 | + "ssm:GetParameterHistory" |
| 99 | + ], |
| 100 | + "Resource": [ |
| 101 | + "arn:aws:ssm:*:*:parameter/myapp/development/*", |
| 102 | + "arn:aws:ssm:*:*:parameter/myapp/staging/*" |
| 103 | + ] |
| 104 | + }, |
| 105 | + { |
| 106 | + "Effect": "Allow", |
| 107 | + "Action": [ |
| 108 | + "kms:Decrypt", |
| 109 | + "kms:Encrypt", |
| 110 | + "kms:GenerateDataKey" |
| 111 | + ], |
| 112 | + "Resource": [ |
| 113 | + "arn:aws:kms:*:*:alias/aws/ssm" |
| 114 | + ] |
| 115 | + } |
| 116 | + ] |
| 117 | +} |
| 118 | +``` |
| 119 | + |
| 120 | +### Production Deployment (Read-Only) |
| 121 | + |
| 122 | +For production deployment processes that only need to read production secrets: |
| 123 | + |
| 124 | +```json |
| 125 | +{ |
| 126 | + "Version": "2012-10-17", |
| 127 | + "Statement": [ |
| 128 | + { |
| 129 | + "Effect": "Allow", |
| 130 | + "Action": [ |
| 131 | + "ssm:GetParameter", |
| 132 | + "ssm:GetParameters", |
| 133 | + "ssm:GetParametersByPath" |
| 134 | + ], |
| 135 | + "Resource": "arn:aws:ssm:*:*:parameter/myapp/production/*" |
| 136 | + }, |
| 137 | + { |
| 138 | + "Effect": "Allow", |
| 139 | + "Action": [ |
| 140 | + "kms:Decrypt" |
| 141 | + ], |
| 142 | + "Resource": [ |
| 143 | + "arn:aws:kms:*:*:alias/aws/ssm" |
| 144 | + ] |
| 145 | + } |
| 146 | + ] |
| 147 | +} |
| 148 | +``` |
| 149 | + |
| 150 | +## Parameter Organization |
| 151 | + |
| 152 | +With the example configuration above, Keep will organize your parameters like this: |
| 153 | + |
| 154 | +``` |
| 155 | +/myapp/ |
| 156 | +├── development/ |
| 157 | +│ ├── DB_PASSWORD |
| 158 | +│ ├── API_KEY |
| 159 | +│ └── NIGHTWATCH_TOKEN |
| 160 | +├── staging/ |
| 161 | +│ ├── DB_PASSWORD |
| 162 | +│ ├── API_KEY |
| 163 | +│ └── NIGHTWATCH_TOKEN |
| 164 | +└── production/ |
| 165 | + ├── DB_PASSWORD |
| 166 | + ├── API_KEY |
| 167 | + └── NIGHTWATCH_TOKEN |
| 168 | +``` |
| 169 | + |
| 170 | +## Security Best Practices |
| 171 | + |
| 172 | +**Use SecureString Type**: Keep automatically creates parameters as `SecureString` when you mark secrets as secure, ensuring they're encrypted at rest. |
| 173 | + |
| 174 | +**Custom KMS Keys**: For highly sensitive applications, use a custom KMS key instead of the AWS managed key for additional control. |
| 175 | + |
| 176 | +**Least Privilege Access**: Grant only the minimum IAM permissions needed for each role. |
| 177 | + |
| 178 | +**Parameter Naming**: Use consistent, descriptive parameter names that align with your application's configuration. |
| 179 | + |
| 180 | +**Regular Rotation**: Leverage Keep's versioning support to regularly rotate sensitive credentials. |
| 181 | + |
| 182 | +## Cost Considerations |
| 183 | + |
| 184 | +**Standard Parameters**: Free for up to 10,000 parameters, then $0.05 per 10,000 API interactions |
| 185 | + |
| 186 | +**Advanced Parameters**: $0.05 per 10,000 API interactions (allows larger values and parameter policies) |
| 187 | + |
| 188 | +**Storage**: No additional storage costs |
| 189 | + |
| 190 | +**Typical Usage**: Most applications will stay within the free tier for parameter storage, with minimal API interaction costs. |
| 191 | + |
| 192 | +## Common Usage Patterns |
| 193 | + |
| 194 | +### Basic Secret Management |
| 195 | +```bash |
| 196 | +# Set a production database password |
| 197 | +keep set DB_PASSWORD --stage=production |
| 198 | + |
| 199 | +# Retrieve for verification |
| 200 | +keep get DB_PASSWORD --stage=production |
| 201 | + |
| 202 | +# Export for deployment |
| 203 | +keep export --stage=production --output=.env |
| 204 | +``` |
| 205 | + |
| 206 | +### Cross-Environment Workflows |
| 207 | +```bash |
| 208 | +# Copy staging secrets to production |
| 209 | +keep copy DB_PASSWORD --from=ssm:staging --to=ssm:production |
| 210 | + |
| 211 | +# Compare environments |
| 212 | +keep diff --stage=staging,production |
| 213 | +``` |
| 214 | + |
| 215 | +### Template-Based Deployment |
| 216 | +```bash |
| 217 | +# Use secrets in templates |
| 218 | +keep merge env.template --stage=production --vault=ssm --output=.env |
| 219 | +``` |
| 220 | + |
| 221 | +## Troubleshooting |
| 222 | + |
| 223 | +**Access Denied Errors**: Verify your IAM permissions include both SSM and KMS actions for the correct resource paths. |
| 224 | + |
| 225 | +**Parameter Not Found**: Check your parameter prefix and namespace configuration match your expected path structure. |
| 226 | + |
| 227 | +**Encryption Issues**: Ensure your IAM role has access to the KMS key being used (either AWS managed or custom). |
| 228 | + |
| 229 | +**Region Mismatch**: Verify you're operating in the same AWS region where your parameters are stored. |
| 230 | + |
| 231 | +## Next Steps |
| 232 | + |
| 233 | +- [AWS Secrets Manager](./aws-secrets-manager) - For more advanced secret rotation features |
| 234 | +- [Template System](../templates) - Learn how to use SSM parameters in templates |
| 235 | +- [Multi-Environment Setup](../../examples/multi-environment) - Best practices for organizing environments |
0 commit comments