Skip to content

Commit c011b0d

Browse files
committed
lint
1 parent 2a43ea4 commit c011b0d

File tree

3 files changed

+70
-68
lines changed

3 files changed

+70
-68
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
export * from './quicksight-subscription'
5-
export * from './quicksight-subscription-props'
4+
export * from './quicksight-subscription';
5+
export * from './quicksight-subscription-props';

framework/src/consumption/lib/quicksight/quicksight-subscription-props.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Duration, RemovalPolicy } from "aws-cdk-lib";
4+
import { Duration, RemovalPolicy } from 'aws-cdk-lib';
55

66

77
/**
88
* The properties for the `QuickSightSubscription` construct
99
*/
1010

1111
export interface QuickSightSubscriptionProps {
12-
12+
1313
/**
1414
* The name of your Amazon QuickSight account.
1515
* This name is unique over all of Amazon Web Services, and it appears only when users sign in.
1616
* You can't change AccountName value after the Amazon QuickSight account is created.
1717
*/
1818
readonly accountName: string;
19-
19+
2020
/**
2121
* The email address that you want Amazon QuickSight to send notifications to regarding your Amazon QuickSight account or Amazon QuickSight subscription.
2222
*/
2323
readonly notificationEmail: string;
24-
24+
2525
/**
2626
* The edition of Amazon QuickSight that you want your account to have. Currently, you can choose from ENTERPRISE or ENTERPRISE_AND_Q .
2727
* @default - ENTERPRISE is used as default.
@@ -32,7 +32,7 @@ export interface QuickSightSubscriptionProps {
3232
* The Amazon Web Services account ID of the account that you're using to create your Amazon QuickSight account.
3333
*/
3434
readonly awsAccountId: string;
35-
35+
3636

3737
/**
3838
* The method that you want to use to authenticate your Amazon QuickSight account.
@@ -43,12 +43,12 @@ export interface QuickSightSubscriptionProps {
4343

4444

4545
/**
46-
* The admin group associated with your Active Directory or IAM Identity Center account. This field is required as IAM_IDENTITY_CENTER is
46+
* The admin group associated with your Active Directory or IAM Identity Center account. This field is required as IAM_IDENTITY_CENTER is
4747
* the only supported authentication method of the new Amazon QuickSight account
4848
*/
4949
readonly adminGroup: string[];
50-
51-
50+
51+
5252
/**
5353
* The author group associated with your IAM Identity Center account.
5454
*/
@@ -70,13 +70,13 @@ export interface QuickSightSubscriptionProps {
7070
*/
7171
readonly executionTimeout?: Duration;
7272

73-
/**
73+
/**
7474
* The removal policy when deleting the CDK resource.
7575
* If DESTROY is selected, context value `@data-solutions-framework-on-aws/removeDataOnDestroy` needs to be set to true.
7676
* Otherwise, the removalPolicy is reverted to RETAIN.
7777
* @default - The resources are not deleted (`RemovalPolicy.RETAIN`).
7878
*/
79-
readonly removalPolicy?: RemovalPolicy;
79+
readonly removalPolicy?: RemovalPolicy;
8080

8181
}
8282

framework/src/consumption/lib/quicksight/quicksight-subscription.ts

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import { CustomResource, Duration, RemovalPolicy } from 'aws-cdk-lib';
99
import { IRole, PolicyDocument, Role , ServicePrincipal, PolicyStatement, Effect } from 'aws-cdk-lib/aws-iam';
1010
import { ILogGroup } from 'aws-cdk-lib/aws-logs';
1111
import { IFunction } from 'aws-cdk-lib/aws-lambda';
12-
13-
12+
import { ILogGroup } from 'aws-cdk-lib/aws-logs';
13+
import { Construct } from 'constructs';
14+
import { QuickSightSubscriptionProps } from './quicksight-subscription-props';
15+
import { Context, TrackedConstruct, TrackedConstructProps } from '../../../utils';
16+
import { DsfProvider } from '../../../utils/lib/dsf-provider';
1417

1518

1619
/**
@@ -24,12 +27,12 @@ import { IFunction } from 'aws-cdk-lib/aws-lambda';
2427
*
2528
*/
2629

27-
export class QuickSightSubscription extends TrackedConstruct{
30+
export class QuickSightSubscription extends TrackedConstruct {
2831

2932
/**
30-
*
33+
*
3134
*/
32-
public static readonly RESOURCE_TYPE = "Custom::QuickSightSubscription";
35+
public static readonly RESOURCE_TYPE = 'Custom::QuickSightSubscription';
3336

3437
/**
3538
* The CloudWatch Log Group for the QuickSight account subscription submission
@@ -67,18 +70,18 @@ export class QuickSightSubscription extends TrackedConstruct{
6770
public readonly cleanUpRole?: IRole;
6871

6972
/**
70-
* The name of your Amazon QuickSight account. This name is unique over all of Amazon Web Services, and it appears only when users sign in.
73+
* The name of your Amazon QuickSight account. This name is unique over all of Amazon Web Services, and it appears only when users sign in.
7174
* You can't change AccountName value after the Amazon QuickSight account is created.
7275
*/
7376
public readonly accountName: string;
74-
75-
/**
77+
78+
/**
7679
* The email address that you want Amazon QuickSight to send notifications to regarding your Amazon QuickSight account or Amazon QuickSight subscription.
7780
*/
7881
readonly notificationEmail: string;
79-
82+
8083
/**
81-
* The admin group associated with your Active Directory or IAM Identity Center account. This field is required as IAM_IDENTITY_CENTER is
84+
* The admin group associated with your Active Directory or IAM Identity Center account. This field is required as IAM_IDENTITY_CENTER is
8285
* the only supported authentication method of the new Amazon QuickSight account
8386
*/
8487
readonly adminGroup: string[];
@@ -102,11 +105,11 @@ export class QuickSightSubscription extends TrackedConstruct{
102105

103106
private readonly serviceToken: string;
104107
private readonly policyActions: string[];
105-
108+
106109
constructor (scope: Construct, id: string, props: QuickSightSubscriptionProps) {
107110
const trackedConstructProps: TrackedConstructProps = {
108111
trackingTag: QuickSightSubscription.name,
109-
};
112+
};
110113
super(scope, id, trackedConstructProps);
111114

112115
this.removalPolicy = Context.revertRemovalPolicy(scope, props.removalPolicy);
@@ -118,54 +121,54 @@ export class QuickSightSubscription extends TrackedConstruct{
118121
this.identityRegion = props.identityRegion;
119122

120123
this.policyActions = [
121-
"quicksight:Subscribe",
122-
"quicksight:UpdateAccountSettings",
123-
"quicksight:Create*",
124-
"quicksight:Unsubscribe",
125-
"quicksight:DescribeAccountSubscription",
126-
"sso:GetManagedApplicationInstance" ,
127-
"sso:CreateManagedApplicationInstance",
128-
"sso:GetManagedApplicationInstance",
129-
"sso:DeleteManagedApplicationInstance",
130-
"sso:GetManagedApplicationInstance",
131-
"sso:DescribeGroup",
132-
"sso:SearchGroups",
133-
"sso:GetProfile",
134-
"sso:AssociateProfile",
135-
"sso:DisassociateProfile",
136-
"sso:ListProfiles",
137-
"sso:ListDirectoryAssociations",
138-
"sso:DescribeRegisteredRegions"
139-
]
124+
'quicksight:Subscribe',
125+
'quicksight:UpdateAccountSettings',
126+
'quicksight:Create*',
127+
'quicksight:Unsubscribe',
128+
'quicksight:DescribeAccountSubscription',
129+
'sso:GetManagedApplicationInstance',
130+
'sso:CreateManagedApplicationInstance',
131+
'sso:GetManagedApplicationInstance',
132+
'sso:DeleteManagedApplicationInstance',
133+
'sso:GetManagedApplicationInstance',
134+
'sso:DescribeGroup',
135+
'sso:SearchGroups',
136+
'sso:GetProfile',
137+
'sso:AssociateProfile',
138+
'sso:DisassociateProfile',
139+
'sso:ListProfiles',
140+
'sso:ListDirectoryAssociations',
141+
'sso:DescribeRegisteredRegions',
142+
];
140143

141144
if (props.authenticationMethod != QuickSightAuthenticationMethod.IAM_IDENTITY_CENTER) {
142145
this.policyActions = this.policyActions.concat(
143146
[
144-
"ds:AuthorizeApplication",
145-
"ds:UnauthorizeApplication",
146-
"ds:CheckAlias",
147-
"ds:CreateAlias",
148-
"ds:DescribeDirectories",
149-
"ds:DescribeTrusts",
150-
"ds:DeleteDirectory",
151-
"ds:CreateIdentityPoolDirectory"
152-
]
153-
)
147+
'ds:AuthorizeApplication',
148+
'ds:UnauthorizeApplication',
149+
'ds:CheckAlias',
150+
'ds:CreateAlias',
151+
'ds:DescribeDirectories',
152+
'ds:DescribeTrusts',
153+
'ds:DeleteDirectory',
154+
'ds:CreateIdentityPoolDirectory',
155+
],
156+
);
154157
}
155-
158+
156159
this.executionRole = new Role(this, 'Role', {
157160
assumedBy: new ServicePrincipal('lambda.amazonaws.com'),
158161
inlinePolicies: {
159162
QuickSightSubscription: new PolicyDocument({
160-
statements : [
163+
statements: [
161164
new PolicyStatement({
162165
effect: Effect.ALLOW,
163166
actions: this.policyActions,
164-
resources: ['*']
165-
})
166-
]
167-
})
168-
}
167+
resources: ['*'],
168+
}),
169+
],
170+
}),
171+
},
169172
});
170173

171174
const timeout = props.executionTimeout ?? Duration.minutes(5);
@@ -180,7 +183,7 @@ export class QuickSightSubscription extends TrackedConstruct{
180183
AUTHENTICATION_METHOD: props.authenticationMethod,
181184
AWS_ACCOUNT_ID: props.awsAccountId,
182185
EDITION: props.edition,
183-
IDENTITY_REGION: props.identityRegion
186+
IDENTITY_REGION: props.identityRegion,
184187
},
185188
iamRole: this.executionRole,
186189
timeout,
@@ -195,7 +198,7 @@ export class QuickSightSubscription extends TrackedConstruct{
195198
AUTHENTICATION_METHOD: props.authenticationMethod,
196199
AWS_ACCOUNT_ID: props.awsAccountId,
197200
EDITION: props.edition,
198-
IDENTITY_REGION: props.identityRegion
201+
IDENTITY_REGION: props.identityRegion,
199202
},
200203
},
201204
queryInterval: Duration.seconds(10),
@@ -209,13 +212,12 @@ export class QuickSightSubscription extends TrackedConstruct{
209212
this.submitFunction = provider.onEventHandlerFunction;
210213
this.statusFunction = provider.isCompleteHandlerFunction!;
211214
this.cleanUpFunction = provider.cleanUpFunction;
212-
this.cleanUpRole = provider.cleanUpRole;
215+
this.cleanUpRole = provider.cleanUpRole;
213216

214217
}
215218

216-
217219

218-
public createQuickSightSubscription(){
220+
public createQuickSightSubscription() {
219221
return new CustomResource(this, 'QuickSightSubscription', {
220222
resourceType: QuickSightSubscription.RESOURCE_TYPE,
221223
serviceToken: this.serviceToken,
@@ -224,9 +226,9 @@ export class QuickSightSubscription extends TrackedConstruct{
224226
notificationEmail: this.notificationEmail,
225227
readerGroup: this.readerGroup,
226228
authorGroup: this.authorGroup,
227-
adminGroup: this.adminGroup
229+
adminGroup: this.adminGroup,
228230
},
229-
removalPolicy: this.removalPolicy
230-
});
231+
removalPolicy: this.removalPolicy,
232+
});
231233
}
232234
}

0 commit comments

Comments
 (0)