Skip to content

Commit

Permalink
Merge pull request #79 from turbot/release/v1.0.0
Browse files Browse the repository at this point in the history
Release/v1.0.0
  • Loading branch information
misraved authored Oct 22, 2024
2 parents 5d57ce3 + ea9998b commit 4dd60a4
Show file tree
Hide file tree
Showing 130 changed files with 955 additions and 697 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## v1.0.0 (2024-10-22)

_Breaking changes_

- Flowpipe `v1.0.0` is now required. For a full list of CLI changes, please see the [Flowpipe v1.0.0 CHANGELOG](https://flowpipe.io/changelog/flowpipe-cli-v1-0-0).
- In Flowpipe configuration files (`.fpc`), `credential` and `credential_import` resources have been renamed to `connection` and `connection_import` respectively.
- Renamed all `cred` params to `conn` and updated their types from `string` to `conn`.

_Enhancements_

- Added `library` to the mod's categories.
- Updated the following pipeline tags:
- `type = "featured"` to `recommended = "true"`
- `type = "test"` to `folder = "Tests"`

## v0.4.1 [2024-09-17]

_Bug fixes_
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,38 @@ brew tap turbot/tap
brew install flowpipe
```

### Credentials
### Connections

By default, the following environment variables will be used for authentication:

- `AWS_PROFILE`
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_ACCESS_KEY`

You can also create `credential` resources in configuration files:
You can also create `connection` resources in configuration files:

```sh
vi ~/.flowpipe/config/aws.fpc
```

```hcl
credential "aws" "aws_profile" {
connection "aws" "aws_profile" {
profile = "my-profile"
}
credential "aws" "aws_access_key_pair" {
connection "aws" "aws_access_key_pair" {
access_key = "AKIA..."
secret_key = "dP+C+J..."
}
credential "aws" "aws_session_token" {
connection "aws" "aws_session_token" {
access_key = "AKIA..."
secret_key = "dP+C+J..."
session_token = "AQoDX..."
}
```

For more information on credentials in Flowpipe, please see [Managing Credentials](https://flowpipe.io/docs/run/credentials).
For more information on connections in Flowpipe, please see [Managing Connections](https://flowpipe.io/docs/run/connections).

### Usage

Expand Down Expand Up @@ -116,10 +116,10 @@ Run a pipeline:
flowpipe pipeline run describe_ec2_instances --arg 'instance_ids=["i-1234567890abcdef0", "i-abcdef12345"]' --arg instance_type=t2.micro --arg region=ap-south-1
```

To use a specific `credential`, specify the `cred` pipeline argument:
To use a specific `connection`, specify the `conn` pipeline argument:

```sh
flowpipe pipeline run describe_ec2_instances --arg cred=aws_profile --arg instance_type=t2.micro --arg region=us-east-1
flowpipe pipeline run describe_ec2_instances --arg conn=connection.aws.aws_profile --arg instance_type=t2.micro --arg region=us-east-1
```

## Open Source & Contributing
Expand Down
2 changes: 1 addition & 1 deletion locals.fp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Common descriptions
locals {
cred_param_description = "Name for credentials to use. If not provided, the default credentials will be used."
conn_param_description = "Name of AWS connection to use. If not provided, the default AWS connection will be used."
region_param_description = "The name of the Region."
}
8 changes: 7 additions & 1 deletion mod.fp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ mod "aws" {
color = "#FF9900"
documentation = file("./README.md")
icon = "/images/mods/turbot/aws.svg"
categories = ["public cloud"]
categories = ["library", "public cloud"]

opengraph {
title = "AWS Mod for Flowpipe"
description = "Run pipelines to supercharge your AWS workflows using Flowpipe."
image = "/images/mods/turbot/aws-social-graphic.png"
}

require {
flowpipe {
min_version = "1.0.0"
}
}
}
26 changes: 26 additions & 0 deletions pipelines/account/delete_alternate_contact.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pipeline "delete_alternate_contact" {
title = "Delete Alternate Contact"
description = "Delete an alternate contact for an AWS account."

param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "alternate_contact_type" {
type = string
description = "The type of alternate contact (BILLING, OPERATIONS, SECURITY)."
}

step "container" "delete_alternate_contact" {
image = "public.ecr.aws/aws-cli/aws-cli"

cmd = concat(
["account", "delete-alternate-contact"],
["--alternate-contact-type", param.alternate_contact_type]
)

env = param.conn.env
}
}
16 changes: 5 additions & 11 deletions pipelines/account/put_alternate_contact.fp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ 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 "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "alternate_contact_type" {
Expand Down Expand Up @@ -43,14 +38,13 @@ pipeline "put_alternate_contact" {

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
env = param.conn.env
}
}
12 changes: 6 additions & 6 deletions pipelines/apigateway/modify_apigateway_rest_api_stage.fp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pipeline "modify_apigateway_rest_api_stage" {
title = "Modify API Gateway 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 "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "rest_api_id" {
Expand All @@ -33,6 +33,6 @@ pipeline "modify_apigateway_rest_api_stage" {
"--patch-operations", "op=replace,path=/tracingEnabled,value=true",
]

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}
}
10 changes: 5 additions & 5 deletions pipelines/cloudtrail/create_cloudtrail_trail.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "create_cloudtrail_trail" {
description = local.region_param_description
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "name" {
Expand Down Expand Up @@ -50,7 +50,7 @@ pipeline "create_cloudtrail_trail" {

)

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}

output "trail" {
Expand Down
30 changes: 30 additions & 0 deletions pipelines/cloudtrail/delete_cloudtrail_trail.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pipeline "delete_cloudtrail_trail" {
title = "Delete CloudTrail Trail"
description = "Delete a trail with specified name."

param "region" {
type = string
description = local.region_param_description
}

param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "name" {
type = string
description = "The name of the trail."
}

step "container" "delete_cloudtrail_trail" {
image = "public.ecr.aws/aws-cli/aws-cli"

cmd = concat(
["cloudtrail", "delete-trail", "--name", param.name]
)

env = merge(param.conn.env, { AWS_REGION = param.region })
}
}
10 changes: 5 additions & 5 deletions pipelines/cloudtrail/put_cloudtrail_trail_event_selector.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "put_cloudtrail_trail_event_selector" {
description = "The AWS region where the CloudTrail trail is located."
}

param "cred" {
type = string
description = "The AWS credentials to use."
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "trail_name" {
Expand All @@ -34,7 +34,7 @@ pipeline "put_cloudtrail_trail_event_selector" {
]
)

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}

output "trail" {
Expand Down
10 changes: 5 additions & 5 deletions pipelines/cloudtrail/start_cloudtrail_trail_logging.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "start_cloudtrail_trail_logging" {
description = local.region_param_description
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "name" {
Expand All @@ -23,6 +23,6 @@ pipeline "start_cloudtrail_trail_logging" {

cmd = ["cloudtrail", "start-logging", "--name", param.name]

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}
}
10 changes: 5 additions & 5 deletions pipelines/cloudtrail/update_cloudtrail_trail.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "update_cloudtrail_trail" {
description = "The AWS region where the CloudTrail trail is located."
}

param "cred" {
type = string
description = "The AWS credentials to use."
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "trail_name" {
Expand Down Expand Up @@ -63,7 +63,7 @@ pipeline "update_cloudtrail_trail" {
param.kms_key_id != null ? ["--kms-key-id", param.kms_key_id] : []
)

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}

output "trail" {
Expand Down
10 changes: 5 additions & 5 deletions pipelines/cloudwatch/create_cloudwatch_log_group.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "create_cloudwatch_log_group" {
description = local.region_param_description
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "log_group_name" {
Expand Down Expand Up @@ -40,7 +40,7 @@ pipeline "create_cloudwatch_log_group" {
] : []
)

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}

output "log_group_creation" {
Expand Down
10 changes: 5 additions & 5 deletions pipelines/cloudwatch/create_cloudwatch_log_stream.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "create_cloudwatch_log_stream" {
description = local.region_param_description
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "log_group_name" {
Expand All @@ -32,7 +32,7 @@ pipeline "create_cloudwatch_log_stream" {
"--log-stream-name", param.log_stream_name
]

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}

output "log_stream_creation" {
Expand Down
10 changes: 5 additions & 5 deletions pipelines/dynamodb/delete_dynamodb_table.fp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pipeline "delete_dynamodb_table" {
description = local.region_param_description
}

param "cred" {
type = string
description = local.cred_param_description
default = "default"
param "conn" {
type = connection.aws
description = local.conn_param_description
default = connection.aws.default
}

param "table_name" {
Expand All @@ -26,6 +26,6 @@ pipeline "delete_dynamodb_table" {
"--table-name", param.table_name
]

env = merge(credential.aws[param.cred].env, { AWS_REGION = param.region })
env = merge(param.conn.env, { AWS_REGION = param.region })
}
}
Loading

0 comments on commit 4dd60a4

Please sign in to comment.