Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created January 13, 2025 03:49
Show Gist options
  • Select an option

  • Save KyMidd/cfe71f854f40e54d440d31ac8e5372b3 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/cfe71f854f40e54d440d31ac8e5372b3 to your computer and use it in GitHub Desktop.
# Publish alias of new version
resource "aws_lambda_alias" "devopsbot_alias" {
name = "Latest"
function_name = aws_lambda_function.devopsbot_slack.arn
function_version = aws_lambda_function.devopsbot_slack.version
}
# Point lambda function url at new version
resource "aws_lambda_function_url" "DevOpsBot_Slack_Trigger_FunctionUrl" {
function_name = aws_lambda_function.devopsbot_slack.function_name
authorization_type = "NONE"
qualifier = aws_lambda_alias.devopsbot_alias.name
}
# Print the URL we can use to trigger the bot
output "DevOpsBot_Slack_Trigger_FunctionUrl" {
value = aws_lambda_function_url.DevOpsBot_Slack_Trigger_FunctionUrl.function_url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment