generated from linz/template-javascript-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Configure basic Hydro survey stack
- Deploy in a separate job for ease of debugging. - Clarify documentation
- Loading branch information
Showing
8 changed files
with
160 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
#!/usr/bin/env node | ||
import 'source-map-support/register'; | ||
|
||
import * as cdk from 'aws-cdk-lib'; | ||
import { App } from 'aws-cdk-lib'; | ||
|
||
import { HydroSurveyStack } from '../lib/hydro-survey-stack'; | ||
|
||
const app = new cdk.App(); | ||
const app = new App(); | ||
new HydroSurveyStack(app, 'HydroSurveyStack', { | ||
/* If you don't specify 'env', this stack will be environment-agnostic. | ||
* Account/Region-dependent features and context lookups will not work, | ||
* but a single synthesized template can be deployed anywhere. */ | ||
/* Uncomment the next line to specialize this stack for the AWS Account | ||
* and Region that are implied by the current CLI configuration. */ | ||
// env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }, | ||
/* Uncomment the next line if you know exactly what Account and Region you | ||
* want to deploy the stack to. */ | ||
// env: { account: '123456789012', region: 'us-east-1' }, | ||
/* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */ | ||
env: { account: process.env['CDK_DEFAULT_ACCOUNT'], region: process.env['CDK_DEFAULT_REGION'] }, | ||
Check failure on line 10 in bin/hydro-survey.ts GitHub Actions / deploy
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
import * as cdk from 'aws-cdk-lib'; | ||
import { Duration, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib'; | ||
import { Bucket, StorageClass } from 'aws-cdk-lib/aws-s3'; | ||
import { Construct } from 'constructs'; | ||
// import * as sqs from 'aws-cdk-lib/aws-sqs'; | ||
|
||
export class HydroSurveyStack extends cdk.Stack { | ||
constructor(scope: Construct, id: string, props?: cdk.StackProps) { | ||
super(scope, id, props); | ||
export const surveyLandingZoneBucketLogicalId = 'SurveyLandingZone'; | ||
export const surveyProcessingBucketLogicalId = 'SurveyProcessing'; | ||
export const surveyConsumptionBucketLogicalId = 'SurveyConsumption'; | ||
|
||
// The code that defines your stack goes here | ||
export class HydroSurveyStack extends Stack { | ||
constructor(scope: Construct, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
// example resource | ||
// const queue = new sqs.Queue(this, 'HydroSurveyQueue', { | ||
// visibilityTimeout: cdk.Duration.seconds(300) | ||
// }); | ||
new Bucket(this, surveyLandingZoneBucketLogicalId, { | ||
removalPolicy: RemovalPolicy.RETAIN, | ||
}); | ||
new Bucket(this, surveyProcessingBucketLogicalId, { | ||
removalPolicy: RemovalPolicy.RETAIN, | ||
versioned: true, | ||
}); | ||
new Bucket(this, surveyConsumptionBucketLogicalId, { | ||
removalPolicy: RemovalPolicy.RETAIN, | ||
lifecycleRules: [ | ||
{ | ||
transitions: [ | ||
{ | ||
storageClass: StorageClass.INFREQUENT_ACCESS, | ||
transitionAfter: Duration.days(365), | ||
}, | ||
{ | ||
storageClass: StorageClass.GLACIER, | ||
transitionAfter: Duration.days(8 * 365), | ||
}, | ||
], | ||
}, | ||
], | ||
versioned: true, | ||
}); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters