Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: QuickSightSubscription construct #505

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

enriquh
Copy link

@enriquh enriquh commented Mar 25, 2024

Issue #, if available:

Description of changes:

Initial version of the QuickSight construct (QS Subscription functionality using custom resource) for review

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lmouhib lmouhib changed the title Initial version of QuickSightSubscription construct feat: QuickSightSubscription construct Mar 25, 2024


/**
* The method that you want to use to authenticate your Amazon QuickSight account.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this an enum

Copy link
Author

@enriquh enriquh Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

export interface QuickSightSubscriptionProps {

/**
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, can you break the line here to make read easier?

Copy link
Author

@enriquh enriquh Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

* The edition of Amazon QuickSight that you want your account to have. Currently, you can choose from ENTERPRISE or ENTERPRISE_AND_Q .
* @default - ENTERPRISE is used as default.
*/
readonly edition: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this an enum, to avoid bad input.

Copy link
Author

@enriquh enriquh Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

this.executionRole = new Role(this, 'Role', {
assumedBy: new ServicePrincipal('lambda.amazonaws.com'),
managedPolicies: [
ManagedPolicy.fromAwsManagedPolicyName('service-role/AWSLambdaVPCAccessExecutionRole'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We avoid using managed roles as much as possible, can you check the MSK PR for how to build this policy?

Copy link
Author

@enriquh enriquh Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the LambdaExecution role that as we clarified is already added by the CR Provider so will remove it, I am adding QS specific policies as an inline policy (see lines 120-173 on quicksight-subscription.ts) . Let me know if this is ok or shall we use customer managed policies for this.

},
});

const timeout = props.executionTimeout || Duration.minutes(5);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this check null and not false. meaning ?? instead of ||.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

IDENTITY_REGION: props.identityRegion,
},
},
queryInterval: Duration.seconds(1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this too aggressive?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. will raise it to 10s


/**
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is => must ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, will change it

/**
* The method that you want to use to authenticate your Amazon QuickSight account.
* Only IAM_IDENTITY_CENTER, IAM_AND_QUICKSIGHT and IAM_ONLY are supported
* @default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove @default

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

/**
* The Amazon Web Services account ID of the account that you're using to create your Amazon QuickSight account.
*/
readonly awsAccountId: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the benefit of configuring a different account than the CDK one?

Copy link
Author

@enriquh enriquh May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm, this could be benefitial to support the creation of pipelines if we want to support them in the future:

For me the CDK account would be the one used for the development account below in the architecture and then the user would be able to create constants for DEV, PRE, PRO (or any additional stages) they would want to configure. Does it make sense ?

image

}

export enum QuickSightEdition {
ENTERPRISE = 'ENTERPRISE',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add another option?

Copy link
Author

@enriquh enriquh May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add the ENTERPRISE_AND_Q (as standard is rarely used and also won't support templates, or assets as bundle functionality so will break the support to pipelines once we support them).

The only thing with supporting ENTERPRISE_AND_Q is that we need to make aware the customer of the 250$/month fee of enabling Q in the account (irrelevant on whether they use it or no)

/**
*
*/
public static readonly RESOURCE_TYPE = 'Custom::QuickSightSubscription';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be private or directly stored in the constructor

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will move it to the constructor along with the custom resource creation

/**
* The email address that you want Amazon QuickSight to send notifications to regarding your Amazon QuickSight account or Amazon QuickSight subscription.
*/
readonly notificationEmail: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be private? same for the following members?

}


public createQuickSightSubscription() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you bundle the custom resource directly in the constructor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@vgkowski vgkowski linked an issue Jul 23, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Quicksight based construct to dashboard data from the data lake
3 participants