-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Khushboo <[email protected]> Co-authored-by: Priyanka Chatterjee <[email protected]> Co-authored-by: khushboosharma <[email protected]>
- Loading branch information
1 parent
bee68ff
commit e431719
Showing
26 changed files
with
1,107 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
pipeline "put_alternate_contact" { | ||
title = "Put Alternate Contact" | ||
description = "Sets an alternate contact for an AWS account." | ||
|
||
param "cred" { | ||
type = string | ||
description = "The credential profile to use." | ||
default = "default" | ||
} | ||
|
||
param "account_id" { | ||
type = string | ||
description = "The AWS account ID." | ||
} | ||
|
||
param "alternate_contact_type" { | ||
type = string | ||
description = "The type of alternate contact (BILLING, OPERATIONS, SECURITY)." | ||
} | ||
|
||
param "email_address" { | ||
type = string | ||
description = "The email address of the alternate contact." | ||
} | ||
|
||
param "name" { | ||
type = string | ||
description = "The name of the alternate contact." | ||
} | ||
|
||
param "phone_number" { | ||
type = string | ||
description = "The phone number of the alternate contact." | ||
} | ||
|
||
param "title" { | ||
type = string | ||
description = "The title of the alternate contact." | ||
} | ||
|
||
step "container" "put_alternate_contact" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = concat( | ||
["account", "put-alternate-contact"], | ||
["--account-id", param.account_id], | ||
["--alternate-contact-type", param.alternate_contact_type], | ||
["--email-address", param.email_address], | ||
["--name", param.name], | ||
["--phone-number", param.phone_number], | ||
["--title", param.title] | ||
) | ||
|
||
env = credential.aws[param.cred].env | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
pipeline "modify_apigateway_rest_api_stage" { | ||
title = "Modify API Gateway REST API stage" | ||
description = "Modifies settings for API Gateway REST API stage." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "rest_api_id" { | ||
type = string | ||
description = "The REST API ID of API Gateway." | ||
} | ||
|
||
param "stage_name" { | ||
type = string | ||
description = "The stage name of API Gateway REST API." | ||
} | ||
|
||
step "container" "modify_apigateway_rest_api_stage" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = [ | ||
"apigateway", "update-stage", | ||
"--rest-api-id", param.rest_api_id, | ||
"--stage-name", param.stage_name, | ||
"--patch-operations", "op=replace,path=/tracingEnabled,value=true", | ||
] | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
pipeline "create_cloudwatch_log_group" { | ||
title = "Create CloudWatch Log Group" | ||
description = "Creates a new CloudWatch log group." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "log_group_name" { | ||
type = string | ||
description = "The name of the CloudWatch log group to be created." | ||
} | ||
|
||
param "retention_days" { | ||
type = number | ||
description = "The retention period in days for the log group." | ||
optional = true | ||
default = 0 | ||
} | ||
|
||
step "container" "create_log_group" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = concat( | ||
[ | ||
"logs", "create-log-group", | ||
"--log-group-name", param.log_group_name | ||
], | ||
param.retention_days != 0 ? [ | ||
"logs", "put-retention-policy", | ||
"--log-group-name", param.log_group_name, | ||
"--retention-in-days", param.retention_days | ||
] : [] | ||
) | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
|
||
output "log_group_creation" { | ||
description = "Confirmation of the CloudWatch log group creation." | ||
value = "Log group ${param.log_group_name} created successfully." | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
pipeline "create_cloudwatch_log_stream" { | ||
title = "Create CloudWatch Log Stream" | ||
description = "Creates a new CloudWatch log stream within a specified log group." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "log_group_name" { | ||
type = string | ||
description = "The name of the CloudWatch log group in which the log stream will be created." | ||
} | ||
|
||
param "log_stream_name" { | ||
type = string | ||
description = "The name of the CloudWatch log stream to be created." | ||
} | ||
|
||
step "container" "create_log_stream" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = [ | ||
"logs", "create-log-stream", | ||
"--log-group-name", param.log_group_name, | ||
"--log-stream-name", param.log_stream_name | ||
] | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
|
||
output "log_stream_creation" { | ||
description = "Confirmation of the CloudWatch log stream creation." | ||
value = "Log stream ${param.log_stream_name} created successfully in log group ${param.log_group_name}." | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pipeline "update_dynamodb_continuous_backup" { | ||
title = "Update DynamoDB Table Continuous Backup" | ||
description = "Update settings for a DynamoDB Table Continuous Backup." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "table_name" { | ||
type = string | ||
description = "The name of the DynamoDB table to update." | ||
} | ||
|
||
step "container" "update_dynamodb_continuous_backup" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = [ | ||
"dynamodb", "update-continuous-backups", "--table-name", param.table_name, "--point-in-time-recovery-specification", "PointInTimeRecoveryEnabled=true", | ||
] | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
|
||
output "continuous_backups_description" { | ||
description = "Contains the details of a DynamoDB Table Continuous Backup." | ||
value = jsondecode(step.container.update_dynamodb_continuous_backup.stdout).ContinuousBackupsDescription | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pipeline "update_dynamodb_table" { | ||
title = "Update DynamoDB Table" | ||
description = "Update settings for a DynamoDB Table." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "table_name" { | ||
type = string | ||
description = "The name of the DynamoDB table to update." | ||
} | ||
|
||
step "container" "update_dynamodb_table" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = concat( | ||
["dynamodb", "update-table", "--table-name", param.table_name, "--deletion-protection-enabled"], | ||
) | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
|
||
output "table_name" { | ||
description = "Contains the details of a DynamoDB Table." | ||
value = jsondecode(step.container.update_dynamodb_table.stdout).TableDescription | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
pipeline "modify_ebs_snapshot" { | ||
title = "Modify EBS Snapshot" | ||
description = "Modifies an attribute of an Amazon EBS snapshot." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "snapshot_id" { | ||
type = string | ||
description = "The ID of the EBS snapshot to modify." | ||
} | ||
|
||
step "container" "modify_snapshot_attribute" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = [ | ||
"ec2", "modify-snapshot-attribute", | ||
"--snapshot-id", param.snapshot_id, | ||
"--attribute", "createVolumePermission", | ||
"--operation-type", "remove", | ||
"--group", "all" | ||
] | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
pipeline "detach_network_interface" { | ||
title = "Detach Network Interface" | ||
description = "Detaches a specified network interface from an instance by using its attachment ID." | ||
|
||
param "region" { | ||
type = string | ||
description = local.region_param_description | ||
} | ||
|
||
param "cred" { | ||
type = string | ||
description = local.cred_param_description | ||
default = "default" | ||
} | ||
|
||
param "attachment_id" { | ||
type = string | ||
description = "The attachment ID of the network interface. This ID uniquely identifies the connection between the network interface and the instance." | ||
} | ||
|
||
param "force_detach" { | ||
type = bool | ||
description = "Forcefully detach the network interface." | ||
default = true | ||
optional = true | ||
} | ||
|
||
step "container" "detach_interface" { | ||
image = "public.ecr.aws/aws-cli/aws-cli" | ||
|
||
cmd = concat( | ||
[ | ||
"ec2", "detach-network-interface", | ||
"--attachment-id", param.attachment_id | ||
], | ||
param.force_detach ? ["--force"] : [] | ||
) | ||
|
||
env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region }) | ||
} | ||
|
||
output "operation_status" { | ||
description = "Details about the network interface detachment operation." | ||
value = "Network interface with attachment ID ${param.attachment_id} detached successfully." | ||
} | ||
} |
Oops, something went wrong.