File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ class MyStack extends cdk.Stack {
5
5
constructor ( parent , id ) {
6
6
super ( parent , id ) ;
7
7
new sns . Topic ( this , 'topic' ) ;
8
+
9
+ console . log ( new cdk . AvailabilityZoneProvider ( this ) . availabilityZones ) ;
10
+ console . log ( new cdk . SSMParameterProvider ( this , { parameterName : '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2' } ) . parameterValue ( '' ) ) ;
8
11
}
9
12
}
10
13
@@ -21,4 +24,4 @@ const app = new cdk.App();
21
24
new MyStack ( app , 'cdk-toolkit-integration-test-1' ) ;
22
25
new YourStack ( app , 'cdk-toolkit-integration-test-2' ) ;
23
26
24
- app . run ( ) ;
27
+ app . run ( ) ;
Original file line number Diff line number Diff line change @@ -38,16 +38,16 @@ export class SSMContextProviderPlugin implements ContextProviderPlugin {
38
38
public async getValue ( args : { [ key : string ] : any } ) {
39
39
const region = args . region ;
40
40
const account = args . account ;
41
- if ( ! ( 'parameterName' in args . props ) ) {
41
+ if ( ! ( 'parameterName' in args ) ) {
42
42
throw new Error ( 'parameterName must be provided in props for SSMContextProviderPlugin' ) ;
43
43
}
44
- const parameterName = args . props . parameterName ;
44
+ const parameterName = args . parameterName ;
45
45
debug ( `Reading SSM parameter ${ account } :${ region } :${ parameterName } ` ) ;
46
46
47
47
const ssm = await this . aws . ssm ( account , region , Mode . ForReading ) ;
48
48
const response = await ssm . getParameter ( { Name : parameterName } ) . promise ( ) ;
49
49
if ( ! response . Parameter || response . Parameter . Value === undefined ) {
50
- throw new Error ( `SSM parameter not availble in account ${ account } , region ${ region } : ${ parameterName } ` ) ;
50
+ throw new Error ( `SSM parameter not available in account ${ account } , region ${ region } : ${ parameterName } ` ) ;
51
51
}
52
52
return response . Parameter . Value ;
53
53
}
You can’t perform that action at this time.
0 commit comments