Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@ jobs:

- name: Vet
run: go vet ./...

wfctl-strict-contracts:
name: Strict Contract Validation
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Validate strict plugin contracts
run: go run github.com/GoCodeAlone/workflow/cmd/wfctl@v0.20.1 plugin validate --file plugin.json --strict-contracts
Comment on lines +46 to +47
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ before:
hooks:
- go mod tidy
- "sed -i.bak 's/\"version\": \".*\"/\"version\": \"{{ .Version }}\"/' plugin.json && rm -f plugin.json.bak"
- "sed -E -i.bak 's|releases/download/v[0-9]+\\.[0-9]+\\.[0-9]+/workflow-plugin-aws_[0-9]+\\.[0-9]+\\.[0-9]+_|releases/download/v{{ .Version }}/workflow-plugin-aws_{{ .Version }}_|g' plugin.json && rm -f plugin.json.bak"

builds:
- id: workflow-plugin-aws
Expand All @@ -28,6 +29,7 @@ archives:
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- plugin.json
- plugin.contracts.json
- LICENSE

checksum:
Expand Down
1 change: 1 addition & 0 deletions drivers/acm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ACMClient interface {

// ACMDriver manages ACM certificates (infra.certificate).
type ACMDriver struct {
noSensitiveKeys
client ACMClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/alb.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ELBv2Client interface {

// ALBDriver manages Application/Network Load Balancers (infra.load_balancer).
type ALBDriver struct {
noSensitiveKeys
client ELBv2Client
}

Expand Down
1 change: 1 addition & 0 deletions drivers/apigateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type APIGatewayClient interface {

// APIGatewayDriver manages API Gateway v2 APIs (infra.api_gateway).
type APIGatewayDriver struct {
noSensitiveKeys
client APIGatewayClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/ecr.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ECRClient interface {

// ECRDriver manages ECR repositories (infra.registry).
type ECRDriver struct {
noSensitiveKeys
client ECRClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type ECSClient interface {

// ECSDriver manages ECS Fargate services (infra.container_service).
type ECSDriver struct {
noSensitiveKeys
client ECSClient
cluster string
}
Expand Down
1 change: 1 addition & 0 deletions drivers/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type EKSClient interface {

// EKSDriver manages EKS clusters (infra.k8s_cluster).
type EKSDriver struct {
noSensitiveKeys
client EKSClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/elasticache.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ElastiCacheClient interface {

// ElastiCacheDriver manages ElastiCache replication groups (infra.cache).
type ElastiCacheDriver struct {
noSensitiveKeys
client ElastiCacheClient
}

Expand Down
6 changes: 6 additions & 0 deletions drivers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import (
"github.com/GoCodeAlone/workflow/interfaces"
)

// noSensitiveKeys is a zero-size mixin that satisfies the SensitiveKeys method
// of interfaces.ResourceDriver for drivers that have no sensitive output keys.
type noSensitiveKeys struct{}

func (noSensitiveKeys) SensitiveKeys() []string { return nil }

// strPtr returns a pointer to the given string.
func strPtr(s string) *string { return &s }

Expand Down
1 change: 1 addition & 0 deletions drivers/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type IAMClient interface {

// IAMDriver manages IAM roles and policies (infra.iam_role).
type IAMDriver struct {
noSensitiveKeys
client IAMClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type RDSClient interface {

// RDSDriver manages RDS database instances (infra.database).
type RDSDriver struct {
noSensitiveKeys
client RDSClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Route53Client interface {

// Route53Driver manages Route53 hosted zones (infra.dns).
type Route53Driver struct {
noSensitiveKeys
client Route53Client
}

Expand Down
1 change: 1 addition & 0 deletions drivers/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type S3Client interface {

// S3Driver manages S3 buckets (infra.storage).
type S3Driver struct {
noSensitiveKeys
client S3Client
region string
}
Expand Down
1 change: 1 addition & 0 deletions drivers/sg.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type SGClient interface {

// SecurityGroupDriver manages EC2 security groups (infra.firewall).
type SecurityGroupDriver struct {
noSensitiveKeys
client SGClient
}

Expand Down
1 change: 1 addition & 0 deletions drivers/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type VPCClient interface {

// VPCDriver manages AWS VPC resources (infra.vpc).
type VPCDriver struct {
noSensitiveKeys
client VPCClient
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/rds v1.115.0
github.com/aws/aws-sdk-go-v2/service/route53 v1.62.5
github.com/aws/aws-sdk-go-v2/service/s3 v1.97.2
google.golang.org/protobuf v1.36.11
)

require (
Expand Down Expand Up @@ -226,7 +227,6 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20260406210006-6f92a3bedf2d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d // indirect
google.golang.org/grpc v1.80.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.70.0 // indirect
modernc.org/mathutil v1.7.1 // indirect
Expand Down
169 changes: 169 additions & 0 deletions internal/contracts/aws.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions internal/contracts/aws.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

package workflow.plugins.aws.v1;

option go_package = "github.com/GoCodeAlone/workflow-plugin-aws/internal/contracts;contracts";

// AWSProviderConfig is the typed configuration for the iac.provider module
// provided by workflow-plugin-aws. All fields correspond to the map keys
// accepted by the legacy Initialize(ctx, map[string]any) path.
message AWSProviderConfig {
// region is the AWS region (default: us-east-1).
string region = 1;
// access_key_id is the AWS access key ID for static credentials.
string access_key_id = 2;
// secret_access_key is the AWS secret access key for static credentials.
string secret_access_key = 3;
Comment on lines +7 to +16
// ecs_cluster is the default ECS cluster name used by the ECS driver.
string ecs_cluster = 4;
}
Loading
Loading