Repository navigation
Add SSM parameter for the user-bot Slack token - #213
Merged
Merged
Conversation
|
Terraform plan in terraform Plan: 1 to add, 2 to change, 0 to destroy.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
!~ update in-place
Terraform will perform the following actions:
# aws_iam_role_policy.user_bot will be updated in-place
!~ resource "aws_iam_role_policy" "user_bot" {
id = "user-bot:user-bot"
name = "user-bot"
!~ policy = jsonencode(
{
- Statement = [
- {
- Action = "iam:ListUserTags"
- Effect = "Allow"
- Resource = "arn:aws:iam::035866691871:user/*"
- Sid = "ReadUserTags"
},
- {
- Action = "iam:UpdateLoginProfile"
- Condition = {
- StringEquals = {
- "iam:ResourceTag/managed-by" = "terraform-devops-security"
}
}
- Effect = "Allow"
- Resource = "arn:aws:iam::035866691871:user/*"
- Sid = "ResetPasswordOfDevopsSecurityUsersOnly"
},
- {
- Action = [
- "logs:CreateLogStream",
- "logs:PutLogEvents",
]
- Effect = "Allow"
- Resource = "arn:aws:logs:us-east-1:035866691871:log-group:/aws/lambda/user-bot:*"
- Sid = "WriteOwnLogs"
},
]
- Version = "2012-10-17"
}
) -> (known after apply)
# (2 unchanged attributes hidden)
}
# aws_lambda_function.user_bot will be updated in-place
!~ resource "aws_lambda_function" "user_bot" {
id = "user-bot"
tags = {}
# (32 unchanged attributes hidden)
+ environment {
+ variables = {
+ "SLACK_TOKEN_PARAMETER" = "*************************"
}
}
# (3 unchanged blocks hidden)
}
# aws_ssm_parameter.user_bot_slack_token will be created
+ resource "aws_ssm_parameter" "user_bot_slack_token" {
+ arn = (known after apply)
+ data_type = (known after apply)
+ description = "Slack bot token for the user-bot Lambda. Set by hand; see lambda/user-bot/README.md in hackforla/devops-security."
+ has_value_wo = (known after apply)
+ id = (known after apply)
+ insecure_value = (known after apply)
+ key_id = (known after apply)
+ name = "/user-bot/slack-bot-token"
+ region = "us-east-1"
+ tags_all = {
+ "managed-by" = "terraform-devops-security"
}
+ tier = (known after apply)
+ type = "SecureString"
+ value = (sensitive value)
+ value_wo = (write-only attribute)
+ value_wo_version = 1
+ version = (known after apply)
}
Plan: 1 to add, 2 to change, 0 to destroy.✅ Plan applied in Apply Terraform changes on merge #51 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #212 (PR 1 of 2: Terraform; the Lambda change follows in PR 2)
What changes did you make?
SecureString/user-bot/slack-bot-token(us-east-1,prevent_destroy), created from a placeholder through the write-onlyvalue_wo. The real Slack token is set by hand after merge, so it never appears in git or Terraform statessm:GetParameteron that one parameterSLACK_TOKEN_PARAMETERenvironment variable holding the parameter's name, not the tokenterraform/README.mdregeneratedWhy did you make the changes (we will use this info to test)?
(write-only attribute); the function's only change should be theenvironmentblock