Skip to content

Instantly share code, notes, and snippets.

@hpiaia
Created June 18, 2024 16:15
Show Gist options
  • Save hpiaia/b35d621abe7925dde17e714056e2d714 to your computer and use it in GitHub Desktop.
Save hpiaia/b35d621abe7925dde17e714056e2d714 to your computer and use it in GitHub Desktop.
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
~ update in-place
- destroy
Terraform will perform the following actions:
# module.ecs_events.aws_cloudwatch_event_target.ecs_events_deployment_logs will be created
+ resource "aws_cloudwatch_event_target" "ecs_events_deployment_logs" {
+ arn = (known after apply)
+ event_bus_name = "default"
+ id = (known after apply)
+ rule = "ecs-events-deployment"
+ target_id = "ecs-events-deployment-logs"
}
# module.ecs_events.aws_cloudwatch_log_group.ecs_events_deployment will be created
+ resource "aws_cloudwatch_log_group" "ecs_events_deployment" {
+ arn = (known after apply)
+ id = (known after apply)
+ name = "ecs-events-deployment"
+ retention_in_days = 0
+ tags_all = (known after apply)
}
# module.ecs_events.aws_cloudwatch_log_metric_filter.ecs_deployment_errors will be created
+ resource "aws_cloudwatch_log_metric_filter" "ecs_deployment_errors" {
+ id = (known after apply)
+ log_group_name = "ecs-events-deployment"
+ name = "esc-deployment-errors"
+ pattern = "{ $.detail.group = \"*\" && $.detail.eventType = \"ERROR\" }"
+ metric_transformation {
+ dimensions = {
+ "group" = "$.detail.group"
}
+ name = "ECSDeploymentErrors"
+ namespace = "ECSDeploymentEvents"
+ unit = "Count"
+ value = "1"
}
}
# module.kinesis_steams.module.metagraph_f21_checkin_stream.aws_kinesis_stream.stream will be created
+ resource "aws_kinesis_stream" "stream" {
+ arn = (known after apply)
+ encryption_type = "KMS"
+ enforce_consumer_deletion = false
+ id = (known after apply)
+ kms_key_id = "3b10ba4d-a71e-4059-9266-2e5398061a99"
+ name = "metagraph-f21-checkin-production"
+ retention_period = 168
+ shard_count = 0
+ shard_level_metrics = [
+ "IncomingBytes",
+ "IncomingRecords",
+ "IteratorAgeMilliseconds",
+ "OutgoingBytes",
+ "OutgoingRecords",
]
+ tags = {
+ "dor_environment" = "production"
}
+ tags_all = {
+ "dor_environment" = "production"
}
+ stream_mode_details {
+ stream_mode = "ON_DEMAND"
}
}
# module.lambda_functions.module.aws_ec2_instance_updater.aws_lambda_permission.allow_cloudwatch[0] will be created
+ resource "aws_lambda_permission" "allow_cloudwatch" {
+ action = "lambda:InvokeFunction"
+ function_name = "aws-ec2-instance-updater-production"
+ id = (known after apply)
+ principal = "events.amazonaws.com"
+ source_arn = "arn:aws:events:us-west-2:340301842845:rule/aws-ec2-instance-updater-production-timer"
+ statement_id = "aws-ec2-instance-updater-production-timer-permission"
}
# module.lambda_functions.module.pos_integration_queuer.aws_lambda_function.function will be updated in-place
~ resource "aws_lambda_function" "function" {
id = "pos-integration-queuer-production"
~ reserved_concurrent_executions = 1 -> -1
tags = {
"dor_environment" = "production"
}
# (18 unchanged attributes hidden)
# (2 unchanged blocks hidden)
}
# module.lambda_functions.module.shopify-subscription-cancel.aws_cloudwatch_event_rule.timer[0] will be destroyed
# (because aws_cloudwatch_event_rule.timer is not in configuration)
- resource "aws_cloudwatch_event_rule" "timer" {
- arn = "arn:aws:events:us-west-2:340301842845:rule/shopify-subscription-cancel-production-timer" -> null
- event_bus_name = "default" -> null
- id = "shopify-subscription-cancel-production-timer" -> null
- is_enabled = false -> null
- name = "shopify-subscription-cancel-production-timer" -> null
- schedule_expression = "cron(0 11 ? * * *)" -> null
- tags = {} -> null
- tags_all = {} -> null
}
# module.lambda_functions.module.shopify-subscription-cancel.aws_cloudwatch_event_target.timer_target[0] will be destroyed
# (because aws_cloudwatch_event_target.timer_target is not in configuration)
- resource "aws_cloudwatch_event_target" "timer_target" {
- arn = "arn:aws:lambda:us-west-2:340301842845:function:shopify-subscription-cancel-production" -> null
- event_bus_name = "default" -> null
- id = "shopify-subscription-cancel-production-timer-shopify-subscription-cancel-production-timer-target" -> null
- rule = "shopify-subscription-cancel-production-timer" -> null
- target_id = "shopify-subscription-cancel-production-timer-target" -> null
}
# module.lambda_functions.module.shopify-subscription-cancel.aws_cloudwatch_metric_alarm.error_alarm[0] will be destroyed
# (because aws_cloudwatch_metric_alarm.error_alarm is not in configuration)
- resource "aws_cloudwatch_metric_alarm" "error_alarm" {
- actions_enabled = true -> null
- alarm_actions = [
- "arn:aws:sns:us-west-2:340301842845:OpsGenie",
] -> null
- alarm_description = "environment:production,priority:p2" -> null
- alarm_name = "shopify-subscription-cancel-production-alarm-errors" -> null
- arn = "arn:aws:cloudwatch:us-west-2:340301842845:alarm:shopify-subscription-cancel-production-alarm-errors" -> null
- comparison_operator = "GreaterThanThreshold" -> null
- datapoints_to_alarm = 2 -> null
- dimensions = {
- "FunctionName" = "shopify-subscription-cancel-production"
} -> null
- evaluation_periods = 2 -> null
- id = "shopify-subscription-cancel-production-alarm-errors" -> null
- insufficient_data_actions = [] -> null
- metric_name = "Errors" -> null
- namespace = "AWS/Lambda" -> null
- ok_actions = [] -> null
- period = 3600 -> null
- statistic = "Average" -> null
- tags = {} -> null
- tags_all = {} -> null
- threshold = 2 -> null
- treat_missing_data = "missing" -> null
}
# module.lambda_functions.module.shopify-subscription-cancel.aws_lambda_function.function will be destroyed
# (because aws_lambda_function.function is not in configuration)
- resource "aws_lambda_function" "function" {
- architectures = [
- "x86_64",
] -> null
- arn = "arn:aws:lambda:us-west-2:340301842845:function:shopify-subscription-cancel-production" -> null
- filename = "../lib/lambda_function/default_lambda_function.zip" -> null
- function_name = "shopify-subscription-cancel-production" -> null
- handler = "lambda.shopify_subscription_cancel" -> null
- id = "shopify-subscription-cancel-production" -> null
- invoke_arn = "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:340301842845:function:shopify-subscription-cancel-production/invocations" -> null
- last_modified = "2024-04-09T18:48:38.000+0000" -> null
- layers = [] -> null
- memory_size = 512 -> null
- package_type = "Zip" -> null
- publish = false -> null
- qualified_arn = "arn:aws:lambda:us-west-2:340301842845:function:shopify-subscription-cancel-production:$LATEST" -> null
- reserved_concurrent_executions = 1 -> null
- role = "arn:aws:iam::340301842845:role/lambda_all" -> null
- runtime = "nodejs18.x" -> null
- source_code_hash = "9SlwTVrpIiMNsRnVBa4ke6LnYkPlaL4aeYv8dwR78cw=" -> null
- source_code_size = 41434741 -> null
- tags = {
- "dor_environment" = "production"
} -> null
- tags_all = {
- "dor_environment" = "production"
} -> null
- timeout = 900 -> null
- version = "$LATEST" -> null
- environment {
- variables = {
- "DOR_ENVIRONMENT" = "production"
- "RUNNING_ON" = "lambda"
- "RUNTIME_ENV" = "production"
} -> null
}
- tracing_config {
- mode = "PassThrough" -> null
}
}
# module.lambda_functions.module.shopify-subscription-cancel.aws_lambda_permission.allow_cloudwatch[0] will be destroyed
# (because aws_lambda_permission.allow_cloudwatch is not in configuration)
- resource "aws_lambda_permission" "allow_cloudwatch" {
- action = "lambda:InvokeFunction" -> null
- function_name = "shopify-subscription-cancel-production" -> null
- id = "shopify-subscription-cancel-production-timer-permission" -> null
- principal = "events.amazonaws.com" -> null
- source_arn = "arn:aws:events:us-west-2:340301842845:rule/shopify-subscription-cancel-production-timer" -> null
- statement_id = "shopify-subscription-cancel-production-timer-permission" -> null
}
# module.lambda_functions.module.shopify-subscription-updater.aws_cloudwatch_event_rule.timer[0] will be updated in-place
~ resource "aws_cloudwatch_event_rule" "timer" {
id = "shopify-subscription-updater-production-timer"
~ is_enabled = false -> true
name = "shopify-subscription-updater-production-timer"
tags = {}
# (4 unchanged attributes hidden)
}
# module.lambda_functions.module.shopify_subscription_cancel.aws_cloudwatch_event_rule.timer[0] will be destroyed
# (because aws_cloudwatch_event_rule.timer is not in configuration)
- resource "aws_cloudwatch_event_rule" "timer" {
- arn = "arn:aws:events:us-west-2:340301842845:rule/shopify-subscription-cancel-production-timer" -> null
- event_bus_name = "default" -> null
- id = "shopify-subscription-cancel-production-timer" -> null
- is_enabled = false -> null
- name = "shopify-subscription-cancel-production-timer" -> null
- schedule_expression = "cron(0 11 ? * * *)" -> null
- tags = {} -> null
- tags_all = {} -> null
}
# module.lambda_functions.module.slack_notify.aws_cloudwatch_metric_alarm.error_alarm[0] will be updated in-place
~ resource "aws_cloudwatch_metric_alarm" "error_alarm" {
~ alarm_description = "environment:staging,priority:p2" -> "environment:production,priority:p2"
id = "slacknotify-alarm-errors"
tags = {}
# (17 unchanged attributes hidden)
}
# module.lambda_functions.module.slack_notify.aws_lambda_permission.sns[0] will be created
+ resource "aws_lambda_permission" "sns" {
+ action = "lambda:InvokeFunction"
+ function_name = "slack-notify"
+ id = (known after apply)
+ principal = "sns.amazonaws.com"
+ source_arn = "arn:aws:sns:us-west-2:340301842845:slack-notify"
+ statement_id = "slacknotify-sns-permission"
}
# module.lambda_functions.module.stream_metagraph_f21_checkin.aws_cloudwatch_metric_alarm.error_alarm[0] will be created
+ resource "aws_cloudwatch_metric_alarm" "error_alarm" {
+ actions_enabled = true
+ alarm_actions = [
+ "arn:aws:sns:us-west-2:340301842845:OpsGenie",
]
+ alarm_description = "environment:production,priority:p2"
+ alarm_name = "stream-metagraph-f21-checkin-production-alarm-errors"
+ arn = (known after apply)
+ comparison_operator = "GreaterThanThreshold"
+ datapoints_to_alarm = 2
+ dimensions = {
+ "FunctionName" = "stream-metagraph-f21-checkin-production"
}
+ evaluate_low_sample_count_percentiles = (known after apply)
+ evaluation_periods = 2
+ id = (known after apply)
+ metric_name = "Errors"
+ namespace = "AWS/Lambda"
+ period = 3600
+ statistic = "Average"
+ tags_all = (known after apply)
+ threshold = 2
+ treat_missing_data = "missing"
}
# module.lambda_functions.module.stream_metagraph_f21_checkin.aws_lambda_event_source_mapping.kinesis[0] will be created
+ resource "aws_lambda_event_source_mapping" "kinesis" {
+ batch_size = 100
+ bisect_batch_on_function_error = true
+ enabled = true
+ event_source_arn = (known after apply)
+ function_arn = (known after apply)
+ function_name = "stream-metagraph-f21-checkin-production"
+ id = (known after apply)
+ last_modified = (known after apply)
+ last_processing_result = (known after apply)
+ maximum_record_age_in_seconds = (known after apply)
+ maximum_retry_attempts = 20
+ parallelization_factor = (known after apply)
+ starting_position = "LATEST"
+ state = (known after apply)
+ state_transition_reason = (known after apply)
+ uuid = (known after apply)
+ destination_config {
+ on_failure {
+ destination_arn = "arn:aws:sqs:us-west-2:340301842845:deadletter-kinesis-production"
}
}
}
# module.lambda_functions.module.stream_metagraph_f21_checkin.aws_lambda_function.function will be created
+ resource "aws_lambda_function" "function" {
+ architectures = (known after apply)
+ arn = (known after apply)
+ filename = "../lib/lambda_function/default_lambda_function.zip"
+ function_name = "stream-metagraph-f21-checkin-production"
+ handler = "lambda.stream_metagraph_f21_checkin"
+ id = (known after apply)
+ invoke_arn = (known after apply)
+ last_modified = (known after apply)
+ layers = []
+ memory_size = 512
+ package_type = "Zip"
+ publish = false
+ qualified_arn = (known after apply)
+ reserved_concurrent_executions = 3
+ role = "arn:aws:iam::340301842845:role/lambda_all"
+ runtime = "nodejs18.x"
+ signing_job_arn = (known after apply)
+ signing_profile_version_arn = (known after apply)
+ source_code_hash = "kzXPRrQgrGywZCQPfbARNPb4/CJpqmQX0AURvpOKrgE="
+ source_code_size = (known after apply)
+ tags = {
+ "dor_environment" = "production"
}
+ tags_all = {
+ "dor_environment" = "production"
}
+ timeout = 300
+ version = (known after apply)
+ environment {
+ variables = {
+ "DOR_ENVIRONMENT" = "production"
+ "RUNNING_ON" = "lambda"
+ "RUNTIME_ENV" = "production"
}
}
}
Plan: 9 to add, 3 to change, 6 to destroy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment