Skip to content

Commit dde534b

Browse files
authored
Merge branch 'main' into master
2 parents 94971cd + 2e6fc64 commit dde534b

File tree

60 files changed

+7332
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+7332
-27
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.139.0](https://github.com/awslabs/aws-solutions-constructs/compare/v1.138.2...v1.139.0) (2022-02-23)
6+
7+
* Upgraded all patterns to CDK v1.139.0
8+
9+
## [1.138.2](https://github.com/awslabs/aws-solutions-constructs/compare/v2.2.0...v1.138.2) (2022-02-23)
10+
11+
* Upgraded all patterns to CDK v1.138.2
12+
13+
### Features
14+
15+
* **aws-fargate-sqs:** Created new construct ([#588](https://github.com/awslabs/aws-solutions-constructs/issues/588)) ([f7ddf3f](https://github.com/awslabs/aws-solutions-constructs/commit/f7ddf3f66c84a8cec4514ac08e1cb3445593d8bb))
16+
17+
* **aws-fargate-s3:** Created new construct ([#591](https://github.com/awslabs/aws-solutions-constructs/issues/591))
18+
519
## [1.138.1](https://github.com/awslabs/aws-solutions-constructs/compare/v1.138.0...v1.138.1) (2022-01-19)
620

721
* Upgraded all patterns to CDK v1.138.1

CHANGELOG.v2.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.3.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.2.0...v2.3.0) (2022-02-24)
6+
7+
8+
### Features
9+
10+
* Includes all functionality of V1.139.0
11+
* Built upon underlying CDK version V2.7.0
12+
* **aws-fargate-sqs:** Created new construct ([#588](https://github.com/awslabs/aws-solutions-constructs/issues/588)) ([f7ddf3f](https://github.com/awslabs/aws-solutions-constructs/commit/f7ddf3f66c84a8cec4514ac08e1cb3445593d8bb))
13+
* **aws-fargate-s3:** Created new construct ([#591](https://github.com/awslabs/aws-solutions-constructs/issues/591))
14+
515
## [2.2.0](https://github.com/awslabs/aws-solutions-constructs/compare/v2.1.0...v2.2.0) (2022-01-20)
616

717
### Features

DESIGN_GUIDELINES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ Existing Inconsistencies would not be published, that’s for our internal use
305305
| Name | Type | Notes |
306306
| --- | --- | --- |
307307
| queueProps? | sqs.QueueProps ||
308-
| existingQueueObj? | sqs.Qeue ||
308+
| existingQueueObj? | sqs.Queue ||
309309
| deployDeadLetterQueue? | Boolean ||
310310
| deadLetterQueueProps? | sqs.QueueProps ||
311311
| maxReceiveCount | number ||

deployment/v2/align-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const findVersion = process.argv[2];
1010
const replaceVersion = process.argv[3];
1111

1212
// these versions need to be sourced from a config file
13-
const awsCdkLibVersion = '2.4.0';
13+
const awsCdkLibVersion = '2.7.0';
1414
const constructsVersion = '10.0.0';
1515
const MODULE_EXEMPTIONS = new Set([
1616
'@aws-cdk/cloudformation-diff',

source/lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"./patterns/@aws-solutions-constructs/*"
77
],
88
"rejectCycles": "true",
9-
"version": "1.138.1"
9+
"version": "1.139.0"
1010
}

source/lerna.v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"./patterns/@aws-solutions-constructs/*"
77
],
88
"rejectCycles": "true",
9-
"version": "2.2.0"
9+
"version": "2.3.0"
1010
}

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,14 @@
507507
"KinesisStream46752A3E": {
508508
"Type": "AWS::Kinesis::Stream",
509509
"Properties": {
510-
"ShardCount": 1,
511510
"RetentionPeriodHours": 96,
511+
"ShardCount": 1,
512512
"StreamEncryption": {
513513
"EncryptionType": "KMS",
514514
"KeyId": "alias/aws/kinesis"
515+
},
516+
"StreamModeDetails": {
517+
"StreamMode": "PROVISIONED"
515518
}
516519
}
517520
}

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.no-arguments.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,14 @@
543543
"KinesisStream46752A3E": {
544544
"Type": "AWS::Kinesis::Stream",
545545
"Properties": {
546-
"ShardCount": 1,
547546
"RetentionPeriodHours": 24,
547+
"ShardCount": 1,
548548
"StreamEncryption": {
549549
"EncryptionType": "KMS",
550550
"KeyId": "alias/aws/kinesis"
551+
},
552+
"StreamModeDetails": {
553+
"StreamMode": "PROVISIONED"
551554
}
552555
}
553556
}

source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/test/integ.eventbridge-kinesisstreams-existing-eventbus.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"teststream04374A09": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 2,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 2,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/test/integ.eventbridge-kinesisstreams-existing.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"teststream04374A09": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 2,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 2,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/test/integ.eventbridge-kinesisstreams-new-eventbus.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"testeventbridgekinesisstreamKinesisStream2A352C09": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 1,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 1,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-eventbridge-kinesisstreams/test/integ.eventbridge-kinesisstreams-no-arguments.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"testeventbridgekinesisstreamKinesisStream2A352C09": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 1,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 1,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-events-rule-kinesisstreams/test/integ.events-rule-kinesisstreams-existing-eventbus.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"teststream04374A09": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 2,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 2,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-events-rule-kinesisstreams/test/integ.events-rule-kinesisstreams-existing.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"teststream04374A09": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 2,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 2,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-events-rule-kinesisstreams/test/integ.events-rule-kinesisstreams-new-eventbus.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"testeventsrulekinesisstreamtesteventsrulekinesisstreamWKinesisStream67B308F2": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 1,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 1,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},

source/patterns/@aws-solutions-constructs/aws-events-rule-kinesisstreams/test/integ.events-rule-kinesisstreams-no-arguments.expected.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"testeventsrulekinesisstreamtesteventsrulekinesisstreamWKinesisStreamB773BFD9": {
55
"Type": "AWS::Kinesis::Stream",
66
"Properties": {
7-
"ShardCount": 1,
87
"RetentionPeriodHours": 24,
8+
"ShardCount": 1,
99
"StreamEncryption": {
1010
"EncryptionType": "KMS",
1111
"KeyId": "alias/aws/kinesis"
12+
},
13+
"StreamModeDetails": {
14+
"StreamMode": "PROVISIONED"
1215
}
1316
}
1417
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lib/*.js
2+
test/*.js
3+
*.d.ts
4+
coverage
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
lib/*.js
2+
test/*.js
3+
*.js.map
4+
*.d.ts
5+
node_modules
6+
*.generated.ts
7+
dist
8+
.jsii
9+
10+
.LAST_BUILD
11+
.nyc_output
12+
coverage
13+
.nycrc
14+
.LAST_PACKAGE
15+
*.snk
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Exclude typescript source and config
2+
*.ts
3+
tsconfig.json
4+
coverage
5+
.nyc_output
6+
*.tgz
7+
*.snk
8+
*.tsbuildinfo
9+
10+
# Include javascript files and typescript declarations
11+
!*.js
12+
!*.d.ts
13+
14+
# Exclude jsii outdir
15+
dist
16+
17+
# Include .jsii
18+
!.jsii
19+
20+
# Include .jsii
21+
!.jsii
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# aws-fargate-s3 module
2+
<!--BEGIN STABILITY BANNER-->
3+
4+
---
5+
6+
![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge)
7+
8+
> All classes are under active development and subject to non-backward compatible changes or removal in any
9+
> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model.
10+
> This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
11+
12+
---
13+
<!--END STABILITY BANNER-->
14+
15+
| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
16+
|:-------------|:-------------|
17+
<div style="height:8px"></div>
18+
19+
| **Language** | **Package** |
20+
|:-------------|-----------------|
21+
|![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_fargate_s3`|
22+
|![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-fargate-s3`|
23+
|![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.fargates3`|
24+
25+
This AWS Solutions Construct implements an AWS Fargate service that can write/read to an Amazon S3 Bucket
26+
27+
Here is a minimal deployable pattern definition in Typescript:
28+
29+
``` typescript
30+
import { FargateToS3, FargateToS3Props } from '@aws-solutions-constructs/aws-fargate-s3';
31+
32+
const props: FargateToS3Props = {
33+
publicApi: true,
34+
ecrRepositoryArn: "arn of a repo in ECR in your account",
35+
});
36+
37+
new FargateToS3(stack, 'test-construct', props);
38+
```
39+
40+
## Pattern Construct Props
41+
42+
| **Name** | **Type** | **Description** |
43+
|:-------------|:----------------|-----------------|
44+
| publicApi | boolean | Whether the construct is deploying a private or public API. This has implications for the VPC and ALB. |
45+
| vpcProps? | [ec2.VpcProps](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html) | Optional custom properties for a VPC the construct will create. This VPC will be used by the new ALB and any Private Hosted Zone the construct creates (that's why loadBalancerProps and privateHostedZoneProps can't include a VPC). Providing both this and existingVpc is an error. |
46+
| existingVpc? | [ec2.IVpc](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html) | An existing VPC in which to deploy the construct. Providing both this and vpcProps is an error. If the client provides an existing load balancer and/or existing Private Hosted Zone, those constructs must exist in this VPC. |
47+
| clusterProps? | [ecs.ClusterProps](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.ClusterProps.html) | Optional properties to create a new ECS cluster. To provide an existing cluster, use the cluster attribute of fargateServiceProps. |
48+
| ecrRepositoryArn? | string | The arn of an ECR Repository containing the image to use to generate the containers. Either this or the image property of containerDefinitionProps must be provided. format: arn:aws:ecr:*region*:*account number*:repository/*Repository Name* |
49+
| ecrImageVersion? | string | The version of the image to use from the repository. Defaults to 'Latest' |
50+
| containerDefinitionProps? | [ecs.ContainerDefinitionProps \| any](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.ContainerDefinitionProps.html) | Optional props to define the container created for the Fargate Service (defaults found in fargate-defaults.ts) |
51+
| fargateTaskDefinitionProps? | [ecs.FargateTaskDefinitionProps \| any](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.FargateTaskDefinitionProps.html) | Optional props to define the Fargate Task Definition for this construct (defaults found in fargate-defaults.ts) |
52+
| fargateServiceProps? | [ecs.FargateServiceProps \| any](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.FargateServiceProps.html) | Optional values to override default Fargate Task definition properties (fargate-defaults.ts). The construct will default to launching the service is the most isolated subnets available (precedence: Isolated, Private and Public). Override those and other defaults here. |
53+
| existingFargateServiceObject? | [ecs.FargateService](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.FargateService.html) | A Fargate Service already instantiated (probably by another Solutions Construct). If this is specified, then no props defining a new service can be provided, including: existingImageObject, ecrImageVersion, containerDefintionProps, fargateTaskDefinitionProps, ecrRepositoryArn, fargateServiceProps, clusterProps, existingClusterInterface |
54+
| existingContainerDefinitionObject? | [ecs.ContainerDefinition](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.ContainerDefinition.html) | A container definition already instantiated as part of a Fargate service. This must be the container in the existingFargateServiceObject |
55+
|existingBucketInterface?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Existing S3 Bucket interface. Providing this property and `bucketProps` results in an error.|
56+
|bucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Bucket.|
57+
|loggingBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Logging Bucket.|
58+
|logS3AccessLogs?| boolean|Whether to turn on Access Logging for the S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. default - true|
59+
|bucketPermissions?|`string[]`|Optional bucket permissions to grant to the Fargate service. One or more of the following may be specified: `Delete`, `Read`, and `Write`. Default is `ReadWrite` which includes `[s3:GetObject*, s3:GetBucket*, s3:List*, s3:DeleteObject*, s3:PutObject*, s3:Abort*]`.|
60+
|bucketArnEnvironmentVariableName?|string|Optional Name for the S3 bucket arn environment variable set for the container.|
61+
|bucketEnvironmentVariableName?|string|Optional Name for the S3 bucket name environment variable set for the container.|
62+
63+
## Pattern Properties
64+
65+
| **Name** | **Type** | **Description** |
66+
|:-------------|:----------------|-----------------|
67+
| vpc | [ec2.IVpc](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html) | The VPC used by the construct (whether created by the construct or providedb by the client) |
68+
| service | [ecs.FargateService](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.FargateService.html) | The AWS Fargate service used by this construct (whether created by this construct or passed to this construct at initialization) |
69+
| container | [ecs.ContainerDefinition](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-ecs.ContainerDefinition.html) | The container associated with the AWS Fargate service in the service property. |
70+
| s3Bucket? |[s3.IBucket](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Returns an instance of s3.Bucket created by the construct|
71+
| s3BucketInterface |[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Returns an instance of s3.IBucket created by the construct|
72+
| s3LoggingBucket? | [s3.Bucket](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html)|Returns an instance of s3.Bucket created by the construct|
73+
74+
## Default settings
75+
76+
Out of the box implementation of the Construct without any override will set the following defaults:
77+
78+
### AWS Fargate Service
79+
* Sets up an AWS Fargate service
80+
* Uses the existing service if provided
81+
* Creates a new service if none provided.
82+
* Service will run in isolated subnets if available, then private subnets if available and finally public subnets
83+
* Adds environment variables to the container with the ARN and Name of the S3 Bucket
84+
* Add permissions to the container IAM role allowing it to publish to the S3 Bucket
85+
86+
### Amazon S3 Bucket
87+
* Sets up an Amazon S3 Bucket
88+
* Uses an existing bucket if one is provided, otherwise creates a new one
89+
* Adds an Interface Endpoint to the VPC for S3 (the service by default runs in Isolated or Private subnets)
90+
91+
## Architecture
92+
![Architecture Diagram](architecture.png)
93+
94+
***
95+
&copy; Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Loading

0 commit comments

Comments
 (0)