The first step for deploying this solution is to create a dummy configuration placeholder and store it into AWS Secrets Manager. For the time-being, this is just a placeholder and we will come back and update this later.
NOTE (Very Important!): In the src/js directory of this project, there is a file called sm-key.txt. This file is used by the Lambda@Edge function to determine which AWS Secrets Manager secret to pull the configurations from. It is very important that this name matches the name you give the Secret in step 7 of these instructions. For example, if you name your placeholder secret my-cloudfront-secret, the sm-key.txt file must also contain a string called my-cloudfront-secret.
- Navigate to the AWS Console
- Search for
Secrets Managerand click on this service - Click on
Store a new secret - For the
Secret typeselectOther type of secret - In the
Key/value pairssection, provide the following details:Key= configValue= PLACEHOLDER
6. Select the appropriate Encryption key settings for your organization's needs. The default is to use the aws/secretsmanager key.
7. Provide the Secret name - which is "cloudfront/DISTRIBUTION_ID", along with an appropriate Description and a set of Tags that make it easy to identify the Secret. For now, you can skip Resource permissions - you will come back to this later.
- Click on the
Nextbutton. - Provide the
Secret rotationsettings or leave it as the default. - Click on
Next. - Click
Store. - Click on the Secret that was just created.
- Under the
Secret detailssection, copy theSecret ARNand save this to a notepad for later use. - Move on to the next step!
Navigate to Deploy the AWS SAM Stack for the next step.
