Skip to content

Commit

Permalink
Release/v0.4.0 (#64)
Browse files Browse the repository at this point in the history
Co-authored-by: Khushboo <46913995+khushboo9024@users.noreply.github.com>
Co-authored-by: Priyanka Chatterjee <priyanka.chatterjee@turbot.com>
Co-authored-by: khushboosharma <khushboo@turbot.com>
  • Loading branch information
4 people authored Jul 24, 2024
1 parent bee68ff commit e431719
Show file tree
Hide file tree
Showing 26 changed files with 1,107 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.4.0 [2024-07-24]

_What's new?_

- Added 22 new pipelines for seamless integration with your CloudWatch, EC2, IAM, KMS, VPC resources, and more.

## v0.3.0 [2024-05-17]

_What's new?_
Expand Down
56 changes: 56 additions & 0 deletions pipelines/account/put_alternate_contact.fp
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
}
}
38 changes: 38 additions & 0 deletions pipelines/apigateway/modify_apigateway_rest_api_stage.fp
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 })
}
}
50 changes: 50 additions & 0 deletions pipelines/cloudwatch/create_cloudwatch_log_group.fp
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."
}
}
42 changes: 42 additions & 0 deletions pipelines/cloudwatch/create_cloudwatch_log_stream.fp
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}."
}
}
35 changes: 35 additions & 0 deletions pipelines/dynamodb/update_dynamodb_continuous_backup.fp
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
}
}
35 changes: 35 additions & 0 deletions pipelines/dynamodb/update_dynamodb_table.fp
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
}
}
34 changes: 34 additions & 0 deletions pipelines/ebs/modify_ebs_snapshot.fp
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 })
}
}
46 changes: 46 additions & 0 deletions pipelines/ec2/detach_network_interface.fp
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."
}
}
Loading

0 comments on commit e431719

Please sign in to comment.