@@ -31,9 +31,9 @@ IAM][iam].
31
31
32
32
## Create an S3 Bucket
33
33
34
- When AWS Lambda starts up your function, it will download the compiled
35
- randomizer code from an [ Amazon S3] [ s3 ] bucket. You can create a new S3 bucket
36
- using the AWS CLI:
34
+ When AWS Lambda starts up your function, it downloads the compiled randomizer
35
+ code from an [ Amazon S3] [ s3 ] bucket. You can create a new S3 bucket using the
36
+ AWS CLI:
37
37
38
38
``` sh
39
39
aws s3 mb s3://[name]
@@ -50,8 +50,8 @@ want a name that references yourself, your company, etc.
50
50
51
51
The randomizer validates that each HTTP request legitimately came from Slack by
52
52
checking for a special Slack-provided token value in the request parameters.
53
- Since this token is a secret value, we'll store it in the [ AWS Systems Manager
54
- Parameter Store] [ ssm parameter store ] with encryption.
53
+ Since this token is a secret value, you should store it in the [ AWS Systems
54
+ Manager Parameter Store] [ ssm parameter store ] with encryption.
55
55
56
56
Note that the current version of the randomizer only supports the deprecated
57
57
"Verification Token" to validate requests, and not the newer "Signing Secret"
@@ -66,19 +66,19 @@ aws ssm put-parameter --type SecureString --name /Randomizer/SlackToken --value
66
66
```
67
67
68
68
The parameter name in the ` aws ssm ` command is unique within your AWS account,
69
- must start with a ` / ` , and can contain additional slash-separated parts to help
70
- you organize all of the SSM parameters in your account. While the parameter can
71
- be encrypted with the default AWS-managed SSM key, the CloudFormation template
72
- does not currently support encryption with a custom KMS key (which would cost
73
- $1/mo and require additional IAM and KMS setup).
69
+ must start with a ` / ` , and can contain extra slash-separated parts to help
70
+ organize all the SSM parameters in your account. While you can encrypt the
71
+ parameter with the default AWS-managed SSM key, the CloudFormation template
72
+ doesn't support encryption with a custom KMS key (which costs $1/mo and
73
+ requires extra IAM and KMS setup).
74
74
75
75
[ ssm parameter store ] : https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html
76
76
77
77
## Run the Initial Deployment
78
78
79
- Now, we're ready to use AWS [ CloudFormation] [ CloudFormation ] to deploy the
80
- randomizer into our account, with all necessary resources (e.g. the DynamoDB
81
- table for storing groups) automatically created and configured.
79
+ Now, you'll use AWS [ CloudFormation] [ CloudFormation ] to deploy the randomizer
80
+ into your account, with all necessary resources (like the DynamoDB table for
81
+ storing groups) automatically created and configured.
82
82
83
83
Similar to how you picked S3 bucket and SSM parameter names, you'll also need
84
84
to pick a name for your CloudFormation "stack." Like your repository name, this
@@ -107,10 +107,10 @@ deployment:
107
107
./hfc build-deploy Randomizer # or whatever other stack name you chose
108
108
```
109
109
110
- This command will automatically compile the randomizer code for AWS Lambda,
111
- upload it to your S3 bucket, and set it up for use. After some time, the script
112
- will finish and print the webhook URL for Slack. Copy and paste this into the
113
- "URL" field of your Slack slash command configuration, and save it.
110
+ This command automatically compiles the randomizer code for AWS Lambda, uploads
111
+ it to your S3 bucket, sets it up for use, and prints a webhook URL for Slack.
112
+ Copy and paste this into the " URL" field of your Slack slash command
113
+ configuration, and save it.
114
114
115
115
At this point, you should be able to use the randomizer in your Slack
116
116
workspace. Go ahead and try it out!
@@ -119,27 +119,27 @@ workspace. Go ahead and try it out!
119
119
120
120
## Upgrades and Maintenance
121
121
122
- To upgrade the randomizer deployment in your AWS account, run the above command
123
- in a newer version of the randomizer repository.
122
+ To upgrade the randomizer deployment in your AWS account, run
123
+ ` ./hfc build-deploy Randomizer ` in a newer version of the repository.
124
124
125
125
Run ` ./hfc help ` to learn more about additional commands that might be useful.
126
126
127
127
## Notes
128
128
129
129
- The CloudFormation template (Template.yaml) uses the [ AWS SAM] [ sam ]
130
130
transformation to simplify the setup of the Lambda function.
131
- - The DynamoDB table in the template is provisioned in On-Demand capacity mode.
132
- Note that this mode is not eligible for the AWS Free Tier. See the
133
- documentation for [ Read/Write Capacity Mode] [ capacity mode ] for more details.
131
+ - The template provisions the DynamoDB table in On-Demand capacity mode, which
132
+ isn't eligible for the AWS Free Tier. See the [ Read/Write Capacity
133
+ Mode] [ capacity mode ] documentation for details.
134
134
- The default configuration enables [ AWS X-Ray] [ x-ray ] tracing for the function
135
135
and its requests to DynamoDB. X-Ray is free for up to 100,000 traces per month
136
136
for every AWS account, and it's useful to see where each request is spending
137
137
time. However, you can turn it off by passing ` XRayTracingEnabled=false ` to
138
138
the deployment script.
139
139
- My co-workers and I collectively make a little over 500 requests to the
140
140
randomizer per month, and at that small of a volume it's essentially free to
141
- run on AWS even without the 12 month free tier. My _ very rough _ estimate is
142
- that the randomizer probably costs less than $1 per million requests.
141
+ run on AWS even without the 12 month free tier. My _ rough _ estimate is that
142
+ the randomizer costs less than $1 per million requests.
143
143
144
144
[ sam ] : https://github.com/awslabs/serverless-application-model
145
145
[ capacity mode ] : https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html
0 commit comments