terradart_aws 0.30.0 copy "terradart_aws: ^0.30.0" to clipboard
terradart_aws: ^0.30.0 copied to clipboard

[pending analysis]

Curated factory wrappers for AWS resources (hashicorp/aws Terraform provider) for Dart-first Terraform stacks.

terradart_aws #

pub: terradart_aws Dart SDK License: Apache-2.0

Curated factory wrappers for AWS resources (the hashicorp/aws Terraform provider) for Dart-first Terraform stacks.

The catalog is the full hashicorp/aws provider at its exact pin: every resource and data source. Start from a Dart backend on AWS Lambda: an execution role, a managed-policy attachment, the function, a function URL, and a log group, plus the aws_iam_policy_document and aws_caller_identity data sources.

Security & Credentials #

Credentials never appear in synth output by design. The AWS provider schema does not mark its credential arguments sensitive, so AwsProvider leaves them out by name: there is no access_key, secret_key, token, or assume_role_with_web_identity parameter. Authenticate at apply time through the AWS SDK credential chain: AWS_PROFILE with your shared config, AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN, or an instance or task role. assumeRole, defaultTags, ignoreTags and endpoints are typed settings on AwsProvider.

Installation #

dependencies:
  terradart_core: ^0.30.x
  terradart_aws: ^0.30.x

Usage example #

import 'package:terradart_aws/data.dart';
import 'package:terradart_aws/iam.dart';
import 'package:terradart_aws/lambda.dart';
import 'package:terradart_aws/provider.dart';
import 'package:terradart_core/terradart_core.dart';

final class HelloStack extends Stack {
  HelloStack()
      : super(providers: [
          const AwsProvider(
            region: 'us-east-1',
            defaultTags: {'app': 'hello-dart'},
          ),
        ]) {
    final trust = DataAwsIamPolicyDocument(
      localName: 'lambda_trust',
      statement: [
        DataIamPolicyDocumentStatement(
          actions: TfArg.literal(['sts:AssumeRole']),
          principals: [
            DataIamPolicyDocumentStatementPrincipals(
              type: TfArg.literal('Service'),
              identifiers: TfArg.literal(['lambda.amazonaws.com']),
            ),
          ],
        ),
      ],
    );
    addData(trust);
    final role = AwsIamRole(
      localName: 'hello',
      assumeRolePolicy: TfArg.ref(trust.json),
    );
    add(role);
    add(AwsLambdaFunction(
      localName: 'hello',
      functionName: TfArg.literal('hello-dart'),
      role: TfArg.ref(role.arn),
      runtime: TfArg.literal('provided.al2023'),
      handler: TfArg.literal('bootstrap'),
      filename: TfArg.literal('build/bootstrap.zip'),
    ));
  }
}
dart pub get
dart run bin/infra.dart
cd tf-out && terraform init && AWS_PROFILE=... terraform apply

Curated surface #

Every resource and data source of the pinned provider, across per-service barrels (ec2, iam, lambda, s3, rds, …) plus data. The provider is pinned exactly (kAwsProviderVersionConstraint, the release the wrappers were generated from). Start with examples/aws_lambda_quickstart, which builds the bootstrap zip from a Dart handler. examples/aws_static_site_quickstart hosts a Flutter Web build on S3 + CloudFront with a custom domain, and examples/aws_ecs_express_quickstart runs a Dart server on ECS Express Mode; both need real AWS setup to apply (their READMEs' "Before you apply"). The rest of the catalog is exercised by examples/aws_leftover_quickstart (synth + terraform validate only).

The six most deeply nested resources (AwsWafv2WebAcl, AwsWafv2WebAclRule, AwsWafv2RuleGroup, AwsQuicksightAnalysis, AwsQuicksightDashboard, AwsQuicksightTemplate) take typed nested helpers, but a block shape that repeats inside one resource gets one helper, named after its shallowest occurrence. AwsWafv2WebAclRule(challengeConfig: ...) therefore takes Wafv2WebAclRuleCaptchaConfig, and an asnMatchStatement nested inside andStatement levels takes the same Wafv2WebAclRuleStatementAsnMatchStatement as a top-level one. The inline rule blocks on AwsWafv2WebAcl stay a TfArg<Map<String, dynamic>> map; manage rules through AwsWafv2WebAclRule for the typed form.

Generated by the maintainer pipeline (terradart wrap against the pin fixture); do not hand-edit files under lib/src/.

1
likes
0
points
72
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

Curated factory wrappers for AWS resources (hashicorp/aws Terraform provider) for Dart-first Terraform stacks.

Repository (GitHub)
View/report issues

Topics

#terraform #infrastructure #codegen #aws

License

(pending) (license)

Dependencies

meta, terradart_core

More

Packages that depend on terradart_aws