From becb483cb990be306007b0fe49f1d4ebee883fa7 Mon Sep 17 00:00:00 2001 From: Umut Date: Sat, 29 May 2021 19:59:20 +0300 Subject: [PATCH] secretnames organized + readme updated --- README.md | 16 ++-------------- lib/cdk-spring-pipeline-stack.ts | 5 ++--- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7d7f933..a5de86b 100644 --- a/README.md +++ b/README.md @@ -62,18 +62,7 @@ You need to create following - Personal access token: https://github.com/settings/tokens/new - Token: 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 -`CDKSpringPipeline` class`cdk-spring-pipeline-stack.ts`. Dependant on your secret name oauth value is mutable and you can change it in below. -```typescript -new codepipelineactions.GitHubSourceAction({ - actionName: 'GitHub_Source', - owner: '', - repo: '', - branch: '', - oauthToken: cdk.SecretValue.secretsManager(""), - output: sourceOutput -}) -``` -Inside of the `gh_token.json` you should pass value as plain text format. ex: `ghp_1234bkLW89212`. [Here](https://github.com/umutykaya/cdk-spring-pipeline/blob/master/assets/docs/github_token.md), it explains to create Github personal access token. Then, create a Secret Manager resource called `pipeline/secret`. +`CDKSpringPipeline` class`cdk-spring-pipeline-stack.ts`. Dependant on your secret name oauth value is mutable and you can change it. Inside of the `gh_token.json` you should pass value as plain text format. ex: `ghp_1234bkLW89212`. [Here](https://github.com/umutykaya/cdk-spring-pipeline/blob/master/assets/docs/github_token.md), it explains to create Github personal access token. Then, create a Secret Manager resource called `pipeline/secret`. ```bash aws secretsmanager create-secret --name pipeline/spring-boot-react \ @@ -87,8 +76,7 @@ aws secretsmanager create-secret --name pipeline/spring-boot-react \ export myIP='0.0.0.0/0' export domainName='subdomain.example.com' export certArn='arn:aws:acm:::certificate/' -export hostedZoneId='zone_id'; -export instanceIdentifier='spring-postgres' +export hostedZoneId='zone_id' export rdsSecretName='pipeline/rds' export owner='repo_owner' export repo='repo_name' diff --git a/lib/cdk-spring-pipeline-stack.ts b/lib/cdk-spring-pipeline-stack.ts index f2f430e..0623a03 100644 --- a/lib/cdk-spring-pipeline-stack.ts +++ b/lib/cdk-spring-pipeline-stack.ts @@ -17,7 +17,6 @@ const myIP = process.env.myIP || '0.0.0.0/0'; const domainName = process.env.domainName || 'subdomain.example.com'; const certArn = process.env.certArn || 'arn:aws:acm:::certificate/'; const hostedZoneId = process.env.hostedZoneId || 'hosted_zone_id'; -const instanceIdentifier = process.env.instanceIdentifier || 'spring-postgres'; const rdsSecretName = process.env.rdsSecretName || 'pipeline/rds'; const owner = process.env.owner || 'umutykaya'; const repo = process.env.repo || 'spring-boot-react'; @@ -66,7 +65,6 @@ export class CDKSpringPipeline extends cdk.Stack { const rdsInstance = new rds.DatabaseInstance(this, 'InstanceWithUsername', { engine, vpc, - instanceIdentifier, securityGroups: [DBGroup], removalPolicy: cdk.RemovalPolicy.DESTROY, deletionProtection: false, @@ -336,9 +334,10 @@ export class CDKSpringPipeline extends cdk.Stack { //OUTPUT new cdk.CfnOutput(this, "publicDNS", { value: bastion.instance.instancePublicDnsName }); new cdk.CfnOutput(this, "instanceID", { value: bastion.instanceId }); - new cdk.CfnOutput(this, "rdsSecretName", { value: rdsSecretName }); new cdk.CfnOutput(this, 'LoadBalancerDNS', { value: fargateService.loadBalancer.loadBalancerDnsName }); + new cdk.CfnOutput(this, "rdsSecretName", { value: rdsSecretName }); new cdk.CfnOutput(this, 'RDSEndpoint', { value: rdsInstance.dbInstanceEndpointAddress }); + new cdk.CfnOutput(this, 'RDSIdentifier', { value: rdsInstance.instanceIdentifier }); } } \ No newline at end of file