Skip to content

Commit

Permalink
secretnames organized + readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
umutykaya committed May 29, 2021
1 parent fdbe31e commit becb483
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<nickname>',
repo: '<repo_name>',
branch: '<branch>',
oauthToken: cdk.SecretValue.secretsManager("<secret_name>"),
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 \
Expand All @@ -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:<region>:<account_id>:certificate/<certificate_id>'
export hostedZoneId='zone_id';
export instanceIdentifier='spring-postgres'
export hostedZoneId='zone_id'
export rdsSecretName='pipeline/rds'
export owner='repo_owner'
export repo='repo_name'
Expand Down
5 changes: 2 additions & 3 deletions lib/cdk-spring-pipeline-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:<region>:<account_id>:certificate/<certificate_id>';
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';
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 });

}
}

0 comments on commit becb483

Please sign in to comment.