UNPKG

cdk-emrserverless-with-delta-lake

Version:
177 lines (176 loc) 11 kB
import * as emr from 'aws-cdk-lib/aws-emr'; import * as iam from 'aws-cdk-lib/aws-iam'; import * as lambda from 'aws-cdk-lib/aws-lambda'; import { Construct } from 'constructs'; import { WorkSpaceBucket } from './buckets'; import { EmrStudioDeveloperStackProps } from './emr-studio-cluster-templates'; /** * What kind of authentication the Studio uses. */ export declare enum StudioAuthMode { /** * the Studio authenticates users using AWS SSO. */ AWS_SSO = "SSO", /** * the Studio authenticates users using AWS IAM. */ AWS_IAM = "IAM" } /** * Options for the EMR Studio, mainly for EMR Serverless applications. */ export interface EmrStudioProps { /** * The custom construct as the workspace S3 bucket. **/ readonly workSpaceBucket: WorkSpaceBucket; /** * The subnet IDs for the EMR studio. * You can select the subnets from the default VPC in your AWS account. */ readonly subnetIds?: Array<string>; /** * Specifies whether the Studio authenticates users using AWS SSO or IAM. * * @default - StudioAuthMode.AWS_IAM. **/ readonly authMode?: StudioAuthMode; /** * The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by VpcId. * * @default - a security group created by `EmrStudioEngineSecurityGroup`. */ readonly engineSecurityGroupId?: string; /** * The ID of the security group used by the workspace. * * @default - a security group created by `EmrStudioWorkspaceSecurityGroup`. */ readonly workSpaceSecurityGroupId?: string; /** * A descriptive name for the Amazon EMR Studio. * * @default - 'emr-sutdio-quicklaunch' */ readonly studioName?: string; /** * Used by the EMR Studio. * * @default - 'The default VPC will be used.' */ readonly vpcId?: string; /** * A detailed description of the Amazon EMR Studio. * * @default - 'EMR Studio Quick Launch - by scott.hsieh' */ readonly description?: string; /** * The custom service role for the EMR Studio. * * @link https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-service-role.html * @default - established by the construct, EmrStudioServiceRole. */ /** * A name for the service role of an EMR Studio. For valid values, see the RoleName parameter for the CreateRole action in the IAM API Reference. * * IMPORTANT: If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. * * If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates. * * @default - 'emr-studio-service-role' */ readonly serviceRoleName?: string; readonly serviceRoleArn?: string; /** * The custom user role for the EMR Studio when authentication is AWS SSO. * * Currently, if you choose to establish an EMR serverless application where the authentication mechanism used by the EMR Studio is AWS SSO, you need to create a user role by yourself and assign the role arn to this argument if AWS SSO is chosen as authentication for the EMR Studio; * * @link https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-user-permissions.html */ readonly userRoleArn?: string; /** * Options for which kind of identity will be associated with the Product of the Porfolio in AWS Service Catalog for EMR cluster templates. * * You can choose either an IAM group, IAM role, or IAM user. If you leave it empty, an IAM user named `Administrator` with the `AdministratorAccess` power needs to be created first. */ readonly serviceCatalogProps?: EmrStudioDeveloperStackProps; } /** * Creates an EMR Studio for EMR Serverless applications. * * The Studio is not only for EMR Serverless applications but also for launching an EMR cluster via a cluster template created in this constrcut to check out results transformed by EMR serverless applications. * * For what Studio can do further, please refer to [Amazon EMR Studio](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio.html). * * ```ts * const workspaceBucket = new WorkSpaceBucket(this, 'EmrStudio'); * const emrStudio = new EmrStudio(this, '', { * workSpaceBucket: workspaceBucket, * subnetIds: ['subnet1', 'subnet2', 'subnet3'] * }); * ``` */ export declare class EmrStudio extends Construct { readonly entity: emr.CfnStudio; constructor(scope: Construct, name: string, props: EmrStudioProps); /** * Add `{'for-use-with-amazon-emr-managed-policies', 'true'}` to a specific construct. * * Please refer to [Create an EMR Studio service role](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-service-role.html) for detail. * @param entity a construct that is intended to be added the specific tag. */ private addProperTag; } /** * Properties for defining the [service role](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-service-role.html) of an EMR Studio. */ export interface EmrStudioServiceRoleProps { /** * The custom construct as the workspace S3 bucket. **/ readonly workSpaceBucket: WorkSpaceBucket; /** * A name for the service role of an EMR Studio. For valid values, see the RoleName parameter for the CreateRole action in the IAM API Reference. * * IMPORTANT: If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. * * If you specify a name, you must specify the CAPABILITY_NAMED_IAM value to acknowledge your template's capabilities. For more information, see Acknowledging IAM Resources in AWS CloudFormation Templates. * * @default - 'emr-studio-service-role' */ readonly roleName?: string; } /** * Creates a default service role for an EMR Studio. * * For detail, please refer to [Create an EMR Studio service role](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-service-role.html). * * ```ts * const workSpaceBucket = new WorkSpaceBucket(this, 'WorkSpace'); * const emrStudioServiceRole = new EmrStudioServiceRole(this, 'Service', { * workSpaceBucket: workSpaceBucket * }); * ``` */ export declare class EmrStudioServiceRole extends Construct { /** * The representative of the default service role for EMR Studio. */ readonly roleEntity: iam.Role; constructor(scope: Construct, name: string, props: EmrStudioServiceRoleProps); } /** * Creates a Lambda function for the custom resource which can add necessary tag onto the VPC and subnets for the EMR Studio during deployment. * * For detail on the tag, please refer to [How to create a service role for EMR Studio](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-studio-service-role.html#emr-studio-service-role-instructions) */ export declare class EmrStudioTaggingExpert extends Construct { /** * The repesentative of the Lambda function for the custom resource which can add necessary tag onto the VPC and subnets for the EMR Studio during deployment. */ readonly functionEntity: lambda.Function; constructor(scope: Construct, name: string); }