Skip to content

Commit

Permalink
feat(test): dns validation role test stack
Browse files Browse the repository at this point in the history
  • Loading branch information
balzanelli committed Apr 8, 2023
1 parent 5e227bd commit 80fdfc3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/bin/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { DnsValidationRoleTestStack } from '../lib/dns-validation-role-test-stack';

const app = new cdk.App();

const props = {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
},
};

new DnsValidationRoleTestStack(app, 'DnsValidationRoleTest', props);
3 changes: 3 additions & 0 deletions test/cdk.context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"AWS_ACCOUNT_ID": ""
}
16 changes: 16 additions & 0 deletions test/lib/dns-validation-role-test-stack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as cdk from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';
import { Construct } from 'constructs';
import { DnsValidationRole } from '../../lib/dns-validation-role';

export class DnsValidationRoleTestStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

new DnsValidationRole(this, 'DnsValidationRole', {
assumedBy: new iam.AccountPrincipal(
scope.node.tryGetContext('AWS_ACCOUNT_ID'),
),
});
}
}

0 comments on commit 80fdfc3

Please sign in to comment.