Skip to content

Commit

Permalink
fix: typo (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabrizioCafolla authored Nov 27, 2023
1 parent 1a38117 commit 12d64e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/stacks/doppler/doppler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface DopplerSecretsManagerStackProps extends BaseStackProps {
readonly withSecretCreation?: boolean;
}

// Docs: see https://docs.doppler.com/docs/aws-secrets-manager
export class DopplerSecretsManagerStack extends BaseStack {
dopplerSecret: secretsmanager.ISecret;
role: iam.IRole;
Expand All @@ -25,14 +26,15 @@ export class DopplerSecretsManagerStack extends BaseStack {
const name = `${props.dopplerSecretName}/${this.stage}/doppler`;

if (props.withSecretCreation) {
new secretsmanager.Secret(
const secret = new secretsmanager.Secret(
this,
'doppler-secret',
{
secretName: name,
secretObjectValue: {},
},
);
this.addBaseTags(secret);
}

this.role = new iam.Role(
Expand Down
31 changes: 15 additions & 16 deletions src/stacks/newrelic/newrelic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
import { Construct } from 'constructs';
import { addBaseTags } from '../../common/utils';
import { BaseStack, BaseStackProps } from '../../stack';


Expand Down Expand Up @@ -87,14 +86,14 @@ export class NewRelicStack extends BaseStack {
}

createCloudwatchMetricStream(firehoseArn: string, props?: CfnMetricStreamProps) {
let role = new iam.Role(
const role = new iam.Role(
this,
'newrelic-cloudwatch-stream-role', {
roleName: 'NewRelicInfrastructure-CloudwatchMetricsStream',
assumedBy: new iam.ServicePrincipal('streams.metrics.cloudwatch.amazonaws.com'),
},
);
addBaseTags(role);
this.addBaseTags(role);

role.addToPolicy(
new iam.PolicyStatement({
Expand All @@ -116,7 +115,7 @@ export class NewRelicStack extends BaseStack {
}

createCloudwatchLogsStreamRole(): iam.IRole {
let role = new iam.Role(
const role = new iam.Role(
this,
'newrelic-logstream-role', {
roleName: 'NewRelicInfrastructure-CloudwatchLogsStream',
Expand All @@ -136,13 +135,13 @@ export class NewRelicStack extends BaseStack {
}),
);

addBaseTags(role);
this.addBaseTags(role);

return role;
}

createNewRelicRole(newRelicAccountId: string): iam.IRole {
let role = new iam.Role(
const role = new iam.Role(
this,
'newrelic-role', {
roleName: 'NewRelicInfrastructure-Integrations',
Expand All @@ -166,7 +165,7 @@ export class NewRelicStack extends BaseStack {
}),
);

addBaseTags(role);
this.addBaseTags(role);

new CfnOutput(this, 'newrelic-role-output', {
value: role.roleArn,
Expand Down Expand Up @@ -194,7 +193,7 @@ export class NewRelicStack extends BaseStack {
sizeInMBs: 15,
};

let httpEndpointMetrics: firehose.CfnDeliveryStream.HttpEndpointDestinationConfigurationProperty = {
const httpEndpointMetrics: firehose.CfnDeliveryStream.HttpEndpointDestinationConfigurationProperty = {
bufferingHints: bufferingHints ?? bufferingHintsDefault,
endpointConfiguration: {
url: endpointUrl,
Expand All @@ -211,7 +210,7 @@ export class NewRelicStack extends BaseStack {
roleArn: role.roleArn,
};

let firehoseStream = new firehose.CfnDeliveryStream(
const firehoseStream = new firehose.CfnDeliveryStream(
this,
`newrelic-firehose-${endpointType}`,
{
Expand All @@ -220,12 +219,12 @@ export class NewRelicStack extends BaseStack {
httpEndpointDestinationConfiguration: httpEndpointMetrics,
},
);
addBaseTags(firehoseStream);
this.addBaseTags(firehoseStream);
return firehoseStream;
}

createSecrets(newRelicAccountId: string, newRelicLicenseLey: string) {
let secret = new secretsmanager.Secret(
const secret = new secretsmanager.Secret(
this,
'newrelic-secret',
{
Expand All @@ -236,12 +235,12 @@ export class NewRelicStack extends BaseStack {
},
},
);
addBaseTags(secret);
this.addBaseTags(secret);
return secret;
}

createFirehoseBucket(newRelicBucketName: string): s3.IBucket {
let bucket = new s3.Bucket(
const bucket = new s3.Bucket(
this,
'newrelic-bucket',
{
Expand All @@ -264,18 +263,18 @@ export class NewRelicStack extends BaseStack {
autoDeleteObjects: true,
},
);
addBaseTags(bucket);
this.addBaseTags(bucket);
return bucket;
}

createFirehoseRole(newRelicFirehoseBucket: s3.IBucket): iam.IRole {
let role = new iam.Role(
const role = new iam.Role(
this,
'newrelic-firehose-role', {
assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'),
},
);
addBaseTags(role);
this.addBaseTags(role);

// TODO: create more restrictive policy
role.addToPolicy(
Expand Down

0 comments on commit 12d64e5

Please sign in to comment.