awsprovider

package
v0.7.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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

func New(cfg aws.Config) *Provider

New creates an AWS provider using the default credential chain. The AWS SDK resolves credentials in standard order:

  1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  2. ~/.aws/credentials
  3. EC2 instance profile / ECS task role

func NewFromAuth

func NewFromAuth(ctx context.Context, auth map[string]string) (*Provider, error)

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

func NewFromContext(ctx context.Context) (*Provider, error)

NewFromContext loads config from the ambient environment and returns a Provider. Convenience constructor for operators that do not manage the aws.Config directly.

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, req orktypes.DeleteRequest) error

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Reconcile

func (p *Provider) Reconcile(ctx context.Context, req orktypes.ReconcileRequest) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL