semvec/pypi-packages huggingface dataset:
cdk-versioned-stack-manager 1.0.5
A CDK construct for dealing with Versioned Stacks - multiple copies of the same stack that would forever grow over time without...this.
License: Apache-2.0
Requires Python: ~=3.8

# cdk-versioned-stack-manager

A CDK construct for dealing with Versioned Stacks - multiple copies of the same stack that would forever grow over time without this. This prevents hitting AWS quotas, but allows for some replication.

## Usage

```python
new cdk.Stack(app, `VersionedStack-${Date.now()}`);

// Inside different stack
new VersionedStackManager(this, 'VersionedStackManager', {
  dryRun: false, // Use this to test the construct, will not actually delete but will log what it would delete
  numberOfStacksToKeep: 5, // Keep this many stacks
  requestId: new Date().toISOString(), // Should change every time you want this to run.
  sortDirection: "DESCENDING", // Optional, defaults to DESCENDING, indicates how your stackNames should be sorted
  stackNamePrefix: 'VersionedStack-' // The pertinent stack names should start with this
});
```

## Use Cases

* Blue/Green Deployments of entire stacks
cdk-nextjs-export-s3-dynamic-routing 1.2.6
Deploy a static export Next.js site to Cloudfront and S3 while maintaining the ability to use dynamic routes.
License: Apache-2.0
Requires Python: ~=3.8

# Next.js Static Export S3 Site with Dynamic Routing

[NPM](https://www.npmjs.com/package/cdk-nextjs-export-s3-dynamic-routing)

[![View on Construct Hub](https://constructs.dev/badge?package=cdk-nextjs-export-s3-dynamic-routing)](https://constructs.dev/packages/cdk-nextjs-export-s3-dynamic-routing)

*Have a more complex use case for Next.js 13? Perhaps check out [cdk-nextjs-standalone](https://constructs.dev/packages/cdk-nextjs-standalone).*

Deploy a static export Next.js site to Cloudfront and S3 while maintaining the ability to use dynamic routes.

This effectively takes all of the benefits of Next.js, including routing, code-splitting, static HTML exporting, and also gives you the benefits of a SPA (single page application). This will be mostly useful for client-generated pages, but you can also partially server side generate some data should you choose.

This may also be useful if you use Next.js SSR in other frontends, and just want to keep a consistent experience for your developers.

## Getting Started

You can use this construct effectively with no props, but here is a minimal example with a custom domain:

```python
export class MyStaticSiteStack extends cdk.Stack {
    private readonly hostedZone: route53.IHostedZone;
    private readonly customDomainName: string;
    private readonly site: NextjsExportS3DynamicRoutingSite;

    constructor(scope: sst.App, id: string, props?: sst.StackProps) {
        super(scope, id, props);

        this.hostedZone = this.findHostedZone();
        this.customDomainName = "yourdomain.com";

        this.site = this.createNextJsSite();
        this.createDnsRecord();
    }

    private findHostedZone(): route53.IHostedZone {
        return route53.HostedZone.fromLookup(this, "HostedZone", {
            domainName: this.customDomainName,
        });
    }

    private createNextJsSite(): NextjsExportS3DynamicRoutingSite {
        const certificate = new acm.Certificate(
            this,
            "Certificate",
            {
                domainName: this.customDomainName,
                validation: acm.CertificateValidation.fromDns(this.hostedZone),
            }
        );

        return new NextjsExportS3DynamicRoutingSite(this, "NextJsSite", {
            distributionProps: {
                certificate,
                domainNames: [this.customDomainName],
            }
        });
    }

    private createDnsRecord = (): route53.ARecord => {
        return new route53.ARecord(this, `AliasRecord`, {
            recordName: this.customDomainName,
            target: route53.RecordTarget.fromAlias(
                new r53Targets.CloudFrontTarget(
                    this.site.cloudfrontDistribution
                )
            ),
            zone: this.hostedZone,
        });
    };
}
```

There are no outside requirements for this construct, and it will delete all of its resources when the stack is deleted.
cdk-cloudfront-associate-alias 1.0.5
A simple construct to handle automated Cloudfront DNS alias migration with zero downtime
License: Apache-2.0
Requires Python: ~=3.8

# cdk-cloudfront-associate-alias

A simple construct to handle automated Cloudfront DNS alias migration with zero downtime.

[NPM Package](https://www.npmjs.com/package/cdk-cloudfront-associate-alias)

[![View on Construct Hub](https://constructs.dev/badge?package=cdk-cloudfront-associate-alias)](https://constructs.dev/packages/cdk-cloudfront-associate-alias)

## Usage

Usage of this construct is fairly straightforward. Simply pass in the Cloudfront distribution, the Route53 hosted zone, and the alias you want to associate with the distribution.

```python
const customDomain = "example.com";
const hostedZone = route53.HostedZone.fromLookup(this, "HostedZone", {
    domainName: DOMAIN_NAME,
});
const targetDistribution =
    cloudfront.Distribution.fromDistributionAttributes(
        this,
        "Distribution",
        {
            distributionId,
            domainName: distributionDomainName,
        },
    );

new CloudfrontAliasAssociator(
    this,
    "AliasAssociator",
    {
        alias: customDomain,
        hostedZone,
        targetDistribution,
    },
);
```

## What this does

This construct will create:

1. A TXT record, this is specific to the API call used, and ensures you have ownership of the domain.
2. A Custom Resource that makes an `AssociateAlias` API call to Cloudfront. This API specifically is for zero downtime alias migration in Cloudfront. This will work even if the domain isn't pre-associated.
3. An A and AAAA alias record that points to the (new) Cloudfront distribution.

## Use Cases

Notably, this construct can be used to provide Blue/Green style deployments for Cloudfront distributions. This means you can create a new distribution, associate the alias with it and this will result in zero downtime for your users.

You can also use this construct in reverse to rollback your alias to the previous deployment (or any other deployment).

For this use case, I recommend pairing this construct with the [cdk-versioned-stack-manager](https://constructs.dev/packages/cdk-versioned-stack-manager) to manage your versioned stacks.
cdk-ssm-secure-iam-access-key 0.0.8
Creates an IAM Access Key for a provided IAM User and stores the result in an SSM SecureString Parameter
License: Apache-2.0
Requires Python: ~=3.8

# cdk-ssm-secure-iam-access-key

Creates an IAM Access Key for a provided IAM User and stores the result in an SSM SecureString Parameter

[NPM Package](https://www.npmjs.com/package/cdk-ssm-secure-iam-access-key)

[![View on Construct Hub](https://constructs.dev/badge?package=cdk-ssm-secure-iam-access-key)](https://constructs.dev/packages/cdk-ssm-secure-iam-access-key)

## Installation

`npm i -D cdk-ssm-secure-iam-access-key`

## Usage

```python
        const user = new iam.User(this, "SMTPUser");

        user.addToPolicy(
            new iam.PolicyStatement({
                effect: iam.Effect.ALLOW,
                actions: ["ses:SendRawEmail"],
                resources: ["*"],
            })
        );

        new SSMSecureIAMAccessKey(this, "SMTPUserCredentials", {
            parameterName: "/smtpCredentials",
            user,
        });

        // JSON.stringified {accessKeyId: "...", secretAccessKey: "..."}
        return ssm.StringParameter.fromSecureStringParameterAttributes(
            this,
            "SMTPUserCredentialsSSM",
            {
                parameterName: "/smtpCredentials",
            }
        );
```