-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
const { awscdk } = require('projen'); | ||
const { Stability } = require('projen/lib/cdk'); | ||
const { UpgradeDependenciesSchedule } = require('projen/lib/javascript'); | ||
|
||
const project = new awscdk.AwsCdkConstructLibrary({ | ||
author: 'Stefan Freitag', | ||
authorAddress: 'stefan.freitag@rwe.com', | ||
cdkVersion: '2.1.0', | ||
authorAddress: 'stefan.freitag@udo.edu', | ||
cdkVersion: '2.69.0', | ||
defaultReleaseBranch: 'main', | ||
name: 'terraform-backend-s3-bucket', | ||
repositoryUrl: 'https://github.com/stefanfreitag/terraform-backend-s3-bucket.git', | ||
codeCov: true, | ||
depsUpgradeOptions: { | ||
workflowOptions: { | ||
schedule: UpgradeDependenciesSchedule.WEEKLY, | ||
}, | ||
}, | ||
stability: Stability.EXPERIMENTAL, | ||
|
||
// deps: [], /* Runtime dependencies of this module. */ | ||
// description: undefined, /* The description is just a string that helps people understand the purpose of the package. */ | ||
// devDeps: [], /* Build dependencies for this module. */ | ||
// packageName: undefined, /* The "name" in package.json. */ | ||
}); | ||
|
||
const common_exclude = ['.history/']; | ||
project.npmignore.exclude(...common_exclude); | ||
project.gitignore.exclude(...common_exclude); | ||
|
||
project.synth(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
# replace this | ||
# Terraform Backend S3 Bucket | ||
|
||
## Features | ||
|
||
- Versioning is enabled | ||
- All public access is blocked | ||
- Enforce SSL for requests |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as aws_dynamodb from 'aws-cdk-lib/aws-dynamodb'; | ||
import { BillingMode } from 'aws-cdk-lib/aws-dynamodb'; | ||
import * as aws_s3 from 'aws-cdk-lib/aws-s3'; | ||
import { BlockPublicAccess, Bucket } from 'aws-cdk-lib/aws-s3'; | ||
import { Construct } from 'constructs'; | ||
//import * as aws_iam from 'aws-cdk-lib/aws-iam' | ||
import { TerraformStateBackendProperties } from './TerraformStateBackendProperties'; | ||
|
||
export class TerraformStateBackend extends Construct { | ||
readonly bucket: aws_s3.IBucket; | ||
readonly table: aws_dynamodb.ITable; | ||
// readonly policy: aws_iam.IPolicy; | ||
|
||
public constructor( | ||
scope: Construct, | ||
id: string, | ||
props: TerraformStateBackendProperties, | ||
) { | ||
super(scope, id); | ||
|
||
this.bucket = new Bucket(this, 'bucket', { | ||
bucketName: props.bucketName, | ||
versioned: true, | ||
blockPublicAccess: BlockPublicAccess.BLOCK_ALL, | ||
enforceSSL: true, | ||
}); | ||
|
||
this.table = new aws_dynamodb.Table(this, 'table', { | ||
partitionKey: { | ||
name: 'LockID', | ||
type: aws_dynamodb.AttributeType.STRING, | ||
}, | ||
billingMode: BillingMode.PAY_PER_REQUEST, | ||
}); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface TerraformStateBackendProperties{ | ||
readonly bucketName: string; | ||
readonly tableName: string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
export class Hello { | ||
public sayHello() { | ||
return 'hello, world!'; | ||
} | ||
} | ||
export * from './TerraformStateBackend'; | ||
export * from './TerraformStateBackendProperties'; |