Documentation
¶
Overview ¶
pkg/providers/aws/provider.go
Real AWS provider for Orkestra.
Handles the "aws" block in Katalog declarations. Uses the official AWS SDK v2 — no mocks, no stubs.
Supported resource kinds:
s3 — S3 buckets (create, versioning, tagging, delete) rds — RDS instances (create, modify, delete, status polling) route53 — Route53 records (upsert, delete)
Installation:
go get github.com/aws/aws-sdk-go-v2 go get github.com/aws/aws-sdk-go-v2/config go get github.com/aws/aws-sdk-go-v2/service/s3 go get github.com/aws/aws-sdk-go-v2/service/rds go get github.com/aws/aws-sdk-go-v2/service/route53
Registration:
cfg, _ := awsconfig.LoadDefaultConfig(ctx) registry.Register(awsprovider.New(cfg))
Credentials:
Standard AWS credential chain — environment variables, ~/.aws/credentials, EC2 instance profile, ECS task role. No special Orkestra configuration needed. For per-CR credentials, specify credentials.secretName in the declaration.
Katalog:
providers:
aws:
- s3:
bucket: "{{ .metadata.name }}-{{ .metadata.namespace }}"
region: "{{ .spec.region }}"
versioning: "true"
- rds:
identifier: "{{ .metadata.name }}-db"
instanceClass: db.t3.micro
engine: postgres
engineVersion: "15"
storage: "20"
multiAZ: "false"
credentials:
secretName: my-aws-creds # optional: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
when:
- field: spec.needsDatabase
equals: "true"
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements orktypes.Provider for the "aws" block.
func New ¶
New creates an AWS provider using the default credential chain. The AWS SDK resolves credentials in standard order:
- Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
- ~/.aws/credentials
- EC2 instance profile / ECS task role
func NewFromAuth ¶
NewFromAuth creates an AWS provider using explicit credentials from a map. Recognised keys: "accessKeyId", "secretAccessKey", "sessionToken", "region". Any missing key falls back to the standard AWS credential chain. Call this when credentials come from the Katalog providers[].auth block.
func NewFromContext ¶
NewFromContext loads config from the ambient environment and returns a Provider. Convenience constructor for operators that do not manage the aws.Config directly.