UNPKG

@cdklabs/aws-data-solutions-framework

Version:
1 lines 601 kB
{"version":"2","toolVersion":"5.8.13","snippets":{"75c962681445a9b3bb3bf0d29a7dc4a52285c0f71b0fb19c2153a1297aaaff40":{"translations":{"python":{"source":"class ExampleDefaultRedshiftServerlessNamespaceStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n dsf.consumption.RedshiftServerlessNamespace(self, \"RedshiftServerlessNamespace\",\n db_name=\"database\",\n name=\"example-namespace\"\n )","version":"2"},"csharp":{"source":"class ExampleDefaultRedshiftServerlessNamespaceStack : Stack\n{\n public ExampleDefaultRedshiftServerlessNamespaceStack(Construct scope, string id) : base(scope, id)\n {\n new Consumption.RedshiftServerlessNamespace(this, \"RedshiftServerlessNamespace\", new RedshiftServerlessNamespaceProps {\n DbName = \"database\",\n Name = \"example-namespace\"\n });\n }\n}","version":"1"},"java":{"source":"public class ExampleDefaultRedshiftServerlessNamespaceStack extends Stack {\n public ExampleDefaultRedshiftServerlessNamespaceStack(Construct scope, String id) {\n super(scope, id);\n RedshiftServerlessNamespace.Builder.create(this, \"RedshiftServerlessNamespace\")\n .dbName(\"database\")\n .name(\"example-namespace\")\n .build();\n }\n}","version":"1"},"go":{"source":"type exampleDefaultRedshiftServerlessNamespaceStack struct {\n\tstack\n}\n\nfunc newExampleDefaultRedshiftServerlessNamespaceStack(scope construct, id *string) *exampleDefaultRedshiftServerlessNamespaceStack {\n\tthis := &exampleDefaultRedshiftServerlessNamespaceStack{}\n\tnewStack_Override(this, scope, id)\n\tconsumption.NewRedshiftServerlessNamespace(this, jsii.String(\"RedshiftServerlessNamespace\"), &RedshiftServerlessNamespaceProps{\n\t\tDbName: jsii.String(\"database\"),\n\t\tName: jsii.String(\"example-namespace\"),\n\t})\n\treturn this\n}","version":"1"},"$":{"source":"class ExampleDefaultRedshiftServerlessNamespaceStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n new dsf.consumption.RedshiftServerlessNamespace(this, \"RedshiftServerlessNamespace\", {\n dbName: \"database\",\n name: \"example-namespace\"\n })\n }\n}","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/aws-data-solutions-framework.consumption"},"field":{"field":"markdown","line":16}},"didCompile":true,"fqnsReferenced":["@cdklabs/aws-data-solutions-framework.consumption","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespaceProps","aws-cdk-lib.Stack","constructs.Construct"],"fullSource":"import { App, Stack } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport * as dsf from '../../index';\n\n/// !show\nclass ExampleDefaultRedshiftServerlessNamespaceStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n new dsf.consumption.RedshiftServerlessNamespace(this, \"RedshiftServerlessNamespace\", {\n dbName: \"database\",\n name: \"example-namespace\" \n })\n }\n}\n/// !hide\nconst app = new App()\nnew ExampleDefaultRedshiftServerlessNamespaceStack(app, \"ExampleDefaultRedshiftServerlessNamespaceStack\")","syntaxKindCounter":{"11":3,"80":12,"108":1,"110":1,"154":1,"169":2,"176":1,"183":1,"210":1,"211":2,"213":1,"214":1,"233":1,"241":1,"244":2,"263":1,"298":1,"303":2},"fqnsFingerprint":"3443c9b061b17cedb8647ac5001a39163150937cc7ec3cc908ede77239ee1505"},"e906bf000f0a4bacc82d4bf2794d8134d7fd0aab5ec83e35eef70394dd7ffee1":{"translations":{"python":{"source":"class ExampleRedshiftServerlessNamespaceRolesStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n\n bucket = Bucket(self, \"ExampleBucket\")\n\n ingestion_role = Role(self, \"IngestionRole\",\n assumed_by=ServicePrincipal(\"redshift.amazonaws.com\"),\n managed_policies=[\n ManagedPolicy.from_aws_managed_policy_name(\"AmazonRedshiftAllCommandsFullAccess\")\n ]\n )\n\n bucket.grant_read(ingestion_role)\n\n dsf.consumption.RedshiftServerlessNamespace(self, \"RedshiftServerlessNamespace\",\n db_name=\"database\",\n name=\"example-namespace\",\n default_iAMRole=ingestion_role\n )","version":"2"},"csharp":{"source":"class ExampleRedshiftServerlessNamespaceRolesStack : Stack\n{\n public ExampleRedshiftServerlessNamespaceRolesStack(Construct scope, string id) : base(scope, id)\n {\n\n var bucket = new Bucket(this, \"ExampleBucket\");\n\n var ingestionRole = new Role(this, \"IngestionRole\", new RoleProps {\n AssumedBy = new ServicePrincipal(\"redshift.amazonaws.com\"),\n ManagedPolicies = new [] { ManagedPolicy.FromAwsManagedPolicyName(\"AmazonRedshiftAllCommandsFullAccess\") }\n });\n\n bucket.GrantRead(ingestionRole);\n\n new Consumption.RedshiftServerlessNamespace(this, \"RedshiftServerlessNamespace\", new RedshiftServerlessNamespaceProps {\n DbName = \"database\",\n Name = \"example-namespace\",\n DefaultIAMRole = ingestionRole\n });\n }\n}","version":"1"},"java":{"source":"public class ExampleRedshiftServerlessNamespaceRolesStack extends Stack {\n public ExampleRedshiftServerlessNamespaceRolesStack(Construct scope, String id) {\n super(scope, id);\n\n Bucket bucket = new Bucket(this, \"ExampleBucket\");\n\n Role ingestionRole = Role.Builder.create(this, \"IngestionRole\")\n .assumedBy(new ServicePrincipal(\"redshift.amazonaws.com\"))\n .managedPolicies(List.of(ManagedPolicy.fromAwsManagedPolicyName(\"AmazonRedshiftAllCommandsFullAccess\")))\n .build();\n\n bucket.grantRead(ingestionRole);\n\n RedshiftServerlessNamespace.Builder.create(this, \"RedshiftServerlessNamespace\")\n .dbName(\"database\")\n .name(\"example-namespace\")\n .defaultIAMRole(ingestionRole)\n .build();\n }\n}","version":"1"},"go":{"source":"type exampleRedshiftServerlessNamespaceRolesStack struct {\n\tstack\n}\n\nfunc newExampleRedshiftServerlessNamespaceRolesStack(scope construct, id *string) *exampleRedshiftServerlessNamespaceRolesStack {\n\tthis := &exampleRedshiftServerlessNamespaceRolesStack{}\n\tnewStack_Override(this, scope, id)\n\n\tbucket := awscdk.NewBucket(this, jsii.String(\"ExampleBucket\"))\n\n\tingestionRole := awscdk.NewRole(this, jsii.String(\"IngestionRole\"), &RoleProps{\n\t\tAssumedBy: awscdk.NewServicePrincipal(jsii.String(\"redshift.amazonaws.com\")),\n\t\tManagedPolicies: []iManagedPolicy{\n\t\t\tawscdk.ManagedPolicy_FromAwsManagedPolicyName(jsii.String(\"AmazonRedshiftAllCommandsFullAccess\")),\n\t\t},\n\t})\n\n\tbucket.GrantRead(ingestionRole)\n\n\tconsumption.NewRedshiftServerlessNamespace(this, jsii.String(\"RedshiftServerlessNamespace\"), &RedshiftServerlessNamespaceProps{\n\t\tDbName: jsii.String(\"database\"),\n\t\tName: jsii.String(\"example-namespace\"),\n\t\tDefaultIAMRole: ingestionRole,\n\t})\n\treturn this\n}","version":"1"},"$":{"source":"class ExampleRedshiftServerlessNamespaceRolesStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n\n const bucket = new Bucket(this, \"ExampleBucket\")\n\n const ingestionRole = new Role(this, \"IngestionRole\", {\n assumedBy: new ServicePrincipal(\"redshift.amazonaws.com\"),\n managedPolicies: [\n ManagedPolicy.fromAwsManagedPolicyName(\"AmazonRedshiftAllCommandsFullAccess\")\n ]\n })\n\n bucket.grantRead(ingestionRole)\n\n new dsf.consumption.RedshiftServerlessNamespace(this, \"RedshiftServerlessNamespace\", {\n dbName: \"database\",\n name: \"example-namespace\",\n defaultIAMRole: ingestionRole\n })\n }\n}","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/aws-data-solutions-framework.consumption"},"field":{"field":"markdown","line":37}},"didCompile":true,"fqnsReferenced":["@cdklabs/aws-data-solutions-framework.consumption","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespaceProps","aws-cdk-lib.Stack","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_iam.IPrincipal","aws-cdk-lib.aws_iam.IRole","aws-cdk-lib.aws_iam.ManagedPolicy#fromAwsManagedPolicyName","aws-cdk-lib.aws_iam.Role","aws-cdk-lib.aws_iam.RoleProps","aws-cdk-lib.aws_iam.ServicePrincipal","aws-cdk-lib.aws_s3.Bucket","aws-cdk-lib.aws_s3.BucketBase#grantRead","constructs.Construct"],"fullSource":"import { App, Stack } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport * as dsf from '../../index';\nimport { Bucket } from \"aws-cdk-lib/aws-s3\";\nimport { ManagedPolicy, Role, ServicePrincipal } from \"aws-cdk-lib/aws-iam\";\n\n/// !show\nclass ExampleRedshiftServerlessNamespaceRolesStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n \n const bucket = new Bucket(this, \"ExampleBucket\")\n \n const ingestionRole = new Role(this, \"IngestionRole\", {\n assumedBy: new ServicePrincipal(\"redshift.amazonaws.com\"),\n managedPolicies: [\n ManagedPolicy.fromAwsManagedPolicyName(\"AmazonRedshiftAllCommandsFullAccess\")\n ]\n })\n \n bucket.grantRead(ingestionRole)\n \n new dsf.consumption.RedshiftServerlessNamespace(this, \"RedshiftServerlessNamespace\", {\n dbName: \"database\",\n name: \"example-namespace\",\n defaultIAMRole: ingestionRole \n })\n }\n}\n/// !hide\nconst app = new App()\nnew ExampleRedshiftServerlessNamespaceRolesStack(app, \"ExampleRedshiftServerlessNamespaceRolesStack\")","syntaxKindCounter":{"11":7,"80":26,"108":1,"110":3,"154":1,"169":2,"176":1,"183":1,"209":1,"210":2,"211":4,"213":3,"214":4,"233":1,"241":1,"243":2,"244":3,"260":2,"261":2,"263":1,"298":1,"303":5},"fqnsFingerprint":"81264a1037fde778bba88ab6f57302762fd6948d19138e8abefd7761a0e1a29a"},"dbad33c72a0fef0d207fa4fa5277b8f95a8799032cc20a7cf11127a16e58fec1":{"translations":{"python":{"source":"class ExampleDefaultRedshiftServerlessWorkgroupStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n\n namespace = dsf.consumption.RedshiftServerlessNamespace(self, \"DefaultRedshiftServerlessNamespace\",\n name=\"default\",\n db_name=\"defaultdb\"\n )\n\n dsf.consumption.RedshiftServerlessWorkgroup(self, \"DefaultRedshiftServerlessWorkgroup\",\n name=\"default\",\n namespace=namespace\n )","version":"2"},"csharp":{"source":"class ExampleDefaultRedshiftServerlessWorkgroupStack : Stack\n{\n public ExampleDefaultRedshiftServerlessWorkgroupStack(Construct scope, string id) : base(scope, id)\n {\n\n var namespace = new Consumption.RedshiftServerlessNamespace(this, \"DefaultRedshiftServerlessNamespace\", new RedshiftServerlessNamespaceProps {\n Name = \"default\",\n DbName = \"defaultdb\"\n });\n\n new Consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", new RedshiftServerlessWorkgroupProps {\n Name = \"default\",\n Namespace = namespace\n });\n }\n}","version":"1"},"java":{"source":"public class ExampleDefaultRedshiftServerlessWorkgroupStack extends Stack {\n public ExampleDefaultRedshiftServerlessWorkgroupStack(Construct scope, String id) {\n super(scope, id);\n\n RedshiftServerlessNamespace namespace = RedshiftServerlessNamespace.Builder.create(this, \"DefaultRedshiftServerlessNamespace\")\n .name(\"default\")\n .dbName(\"defaultdb\")\n .build();\n\n RedshiftServerlessWorkgroup.Builder.create(this, \"DefaultRedshiftServerlessWorkgroup\")\n .name(\"default\")\n .namespace(namespace)\n .build();\n }\n}","version":"1"},"go":{"source":"type exampleDefaultRedshiftServerlessWorkgroupStack struct {\n\tstack\n}\n\nfunc newExampleDefaultRedshiftServerlessWorkgroupStack(scope construct, id *string) *exampleDefaultRedshiftServerlessWorkgroupStack {\n\tthis := &exampleDefaultRedshiftServerlessWorkgroupStack{}\n\tnewStack_Override(this, scope, id)\n\n\tnamespace := consumption.NewRedshiftServerlessNamespace(this, jsii.String(\"DefaultRedshiftServerlessNamespace\"), &RedshiftServerlessNamespaceProps{\n\t\tName: jsii.String(\"default\"),\n\t\tDbName: jsii.String(\"defaultdb\"),\n\t})\n\n\tconsumption.NewRedshiftServerlessWorkgroup(this, jsii.String(\"DefaultRedshiftServerlessWorkgroup\"), &RedshiftServerlessWorkgroupProps{\n\t\tName: jsii.String(\"default\"),\n\t\tNamespace: namespace,\n\t})\n\treturn this\n}","version":"1"},"$":{"source":"class ExampleDefaultRedshiftServerlessWorkgroupStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n\n const namespace = new dsf.consumption.RedshiftServerlessNamespace(this, 'DefaultRedshiftServerlessNamespace', {\n name: \"default\",\n dbName: 'defaultdb',\n })\n\n new dsf.consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", {\n name: \"default\",\n namespace: namespace,\n })\n }\n}","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/aws-data-solutions-framework.consumption"},"field":{"field":"markdown","line":79}},"didCompile":true,"fqnsReferenced":["@cdklabs/aws-data-solutions-framework.consumption","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespaceProps","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroupProps","aws-cdk-lib.Stack","constructs.Construct"],"fullSource":"import { App, Stack } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport * as dsf from '../../index';\n\n/// !show\nclass ExampleDefaultRedshiftServerlessWorkgroupStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n \n const namespace = new dsf.consumption.RedshiftServerlessNamespace(this, 'DefaultRedshiftServerlessNamespace', {\n name: \"default\",\n dbName: 'defaultdb',\n })\n \n new dsf.consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", {\n name: \"default\",\n namespace: namespace,\n })\n }\n}\n/// !hide\nconst app = new App()\nnew ExampleDefaultRedshiftServerlessWorkgroupStack(app, \"ExampleDefaultRedshiftServerlessWorkgroupStack\")","syntaxKindCounter":{"11":5,"80":19,"108":1,"110":2,"154":1,"169":2,"176":1,"183":1,"210":2,"211":4,"213":1,"214":2,"233":1,"241":1,"243":1,"244":2,"260":1,"261":1,"263":1,"298":1,"303":4},"fqnsFingerprint":"72d07f9e1129e9fe670eba0e619707d8eed9f5f4d3d4a8737f902d6b37b43100"},"b0cd1f36d99e74a29f97c39fd2a44d11c11437be1830b825260209dc28efd97d":{"translations":{"python":{"source":"workgroup = dsf.consumption.RedshiftServerlessWorkgroup(self, \"DefaultRedshiftServerlessWorkgroup\",\n name=\"default\",\n namespace=namespace\n)\n\n# Run a custom SQL to create a customer table\ncreate_table = workgroup.run_custom_sQL(\"CreateCustomerTable\", \"defaultdb\", \"\"\"\n CREATE TABLE customer(\n customer_id varchar(50),\n salutation varchar(5),\n first_name varchar(50),\n last_name varchar(50),\n email_address varchar(100)\n )\n diststyle even\n \"\"\", \"drop table customer\")\n\n# Run a COPY command to load data into the customer table\ningestion = workgroup.ingest_data(\"ExampleCopy\", \"defaultdb\", \"customer\", bucket, \"data-products/customer/\", \"csv ignoreheader 1\")\n\n# Add dependencies between Redshift Data API commands because CDK cannot infer them\ningestion.node.add_dependency(create_table)\n\n# Create an engineering role in the defaultdb\ndb_role = workgroup.create_db_role(\"EngineeringRole\", \"defaultdb\", \"engineering\")\n\n# Grant the engineering role full access to the public schema in the defaultdb\ndb_schema = workgroup.grant_db_schema_to_role(\"EngineeringGrant\", \"defaultdb\", \"public\", \"engineering\")\n\n# Enforce dependencies\ndb_schema.node.add_dependency(db_role)","version":"2"},"csharp":{"source":"var workgroup = new Consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", new RedshiftServerlessWorkgroupProps {\n Name = \"default\",\n Namespace = namespace\n});\n\n// Run a custom SQL to create a customer table\nvar createTable = workgroup.RunCustomSQL(\"CreateCustomerTable\", \"defaultdb\", @\"\n CREATE TABLE customer(\n customer_id varchar(50),\n salutation varchar(5),\n first_name varchar(50),\n last_name varchar(50),\n email_address varchar(100)\n )\n diststyle even\n \", \"drop table customer\");\n\n// Run a COPY command to load data into the customer table\nvar ingestion = workgroup.IngestData(\"ExampleCopy\", \"defaultdb\", \"customer\", bucket, \"data-products/customer/\", \"csv ignoreheader 1\");\n\n// Add dependencies between Redshift Data API commands because CDK cannot infer them\ningestion.Node.AddDependency(createTable);\n\n// Create an engineering role in the defaultdb\nvar dbRole = workgroup.CreateDbRole(\"EngineeringRole\", \"defaultdb\", \"engineering\");\n\n// Grant the engineering role full access to the public schema in the defaultdb\nvar dbSchema = workgroup.GrantDbSchemaToRole(\"EngineeringGrant\", \"defaultdb\", \"public\", \"engineering\");\n\n// Enforce dependencies\ndbSchema.Node.AddDependency(dbRole);","version":"1"},"java":{"source":"RedshiftServerlessWorkgroup workgroup = RedshiftServerlessWorkgroup.Builder.create(this, \"DefaultRedshiftServerlessWorkgroup\")\n .name(\"default\")\n .namespace(namespace)\n .build();\n\n// Run a custom SQL to create a customer table\nCustomResource createTable = workgroup.runCustomSQL(\"CreateCustomerTable\", \"defaultdb\", \"\\n CREATE TABLE customer(\\n customer_id varchar(50), \\n salutation varchar(5), \\n first_name varchar(50), \\n last_name varchar(50), \\n email_address varchar(100)\\n ) \\n diststyle even\\n \", \"drop table customer\");\n\n// Run a COPY command to load data into the customer table\nCustomResource ingestion = workgroup.ingestData(\"ExampleCopy\", \"defaultdb\", \"customer\", bucket, \"data-products/customer/\", \"csv ignoreheader 1\");\n\n// Add dependencies between Redshift Data API commands because CDK cannot infer them\ningestion.node.addDependency(createTable);\n\n// Create an engineering role in the defaultdb\nCustomResource dbRole = workgroup.createDbRole(\"EngineeringRole\", \"defaultdb\", \"engineering\");\n\n// Grant the engineering role full access to the public schema in the defaultdb\nCustomResource dbSchema = workgroup.grantDbSchemaToRole(\"EngineeringGrant\", \"defaultdb\", \"public\", \"engineering\");\n\n// Enforce dependencies\ndbSchema.node.addDependency(dbRole);","version":"1"},"go":{"source":"workgroup := consumption.NewRedshiftServerlessWorkgroup(this, jsii.String(\"DefaultRedshiftServerlessWorkgroup\"), &RedshiftServerlessWorkgroupProps{\n\tName: jsii.String(\"default\"),\n\tNamespace: namespace,\n})\n\n// Run a custom SQL to create a customer table\ncreateTable := workgroup.RunCustomSQL(jsii.String(\"CreateCustomerTable\"), jsii.String(\"defaultdb\"), jsii.String(`\n CREATE TABLE customer(\n customer_id varchar(50),\n salutation varchar(5),\n first_name varchar(50),\n last_name varchar(50),\n email_address varchar(100)\n )\n diststyle even\n `), jsii.String(\"drop table customer\"))\n\n// Run a COPY command to load data into the customer table\ningestion := workgroup.IngestData(jsii.String(\"ExampleCopy\"), jsii.String(\"defaultdb\"), jsii.String(\"customer\"), bucket, jsii.String(\"data-products/customer/\"), jsii.String(\"csv ignoreheader 1\"))\n\n// Add dependencies between Redshift Data API commands because CDK cannot infer them\ningestion.Node.AddDependency(createTable)\n\n// Create an engineering role in the defaultdb\ndbRole := workgroup.CreateDbRole(jsii.String(\"EngineeringRole\"), jsii.String(\"defaultdb\"), jsii.String(\"engineering\"))\n\n// Grant the engineering role full access to the public schema in the defaultdb\ndbSchema := workgroup.GrantDbSchemaToRole(jsii.String(\"EngineeringGrant\"), jsii.String(\"defaultdb\"), jsii.String(\"public\"), jsii.String(\"engineering\"))\n\n// Enforce dependencies\ndbSchema.Node.AddDependency(dbRole)","version":"1"},"$":{"source":" const workgroup = new dsf.consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", {\n name: \"default\",\n namespace: namespace,\n })\n\n // Run a custom SQL to create a customer table\n const createTable = workgroup.runCustomSQL('CreateCustomerTable', \"defaultdb\",\n `\n CREATE TABLE customer(\n customer_id varchar(50),\n salutation varchar(5),\n first_name varchar(50),\n last_name varchar(50),\n email_address varchar(100)\n )\n diststyle even\n `,\n \"drop table customer\"\n );\n\n // Run a COPY command to load data into the customer table\n const ingestion = workgroup.ingestData('ExampleCopy', \"defaultdb\", \"customer\", bucket, \"data-products/customer/\", \"csv ignoreheader 1\");\n\n // Add dependencies between Redshift Data API commands because CDK cannot infer them\n ingestion.node.addDependency(createTable);\n\n // Create an engineering role in the defaultdb\n const dbRole = workgroup.createDbRole('EngineeringRole', 'defaultdb', 'engineering');\n\n // Grant the engineering role full access to the public schema in the defaultdb\n const dbSchema = workgroup.grantDbSchemaToRole('EngineeringGrant', 'defaultdb', 'public', 'engineering');\n\n // Enforce dependencies\n dbSchema.node.addDependency(dbRole);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/aws-data-solutions-framework.consumption"},"field":{"field":"markdown","line":108}},"didCompile":true,"fqnsReferenced":["@cdklabs/aws-data-solutions-framework.consumption","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#createDbRole","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#grantDbSchemaToRole","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#ingestData","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#runCustomSQL","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroupProps","aws-cdk-lib.CustomResource","aws-cdk-lib.aws_iam.IPrincipal","aws-cdk-lib.aws_s3.IBucket","constructs.Construct","constructs.Construct#node","constructs.IDependable","constructs.Node#addDependency"],"fullSource":"import { App, Stack } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport * as dsf from '../../index';\nimport { Bucket } from \"aws-cdk-lib/aws-s3\";\nimport { ManagedPolicy, Role, ServicePrincipal } from \"aws-cdk-lib/aws-iam\";\n\nclass ExampleRedshiftServerlessWorkgroupBootstrapStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n \n const bucket = new Bucket(this, \"ExampleDataBucket\")\n \n const ingestionRole = new Role(this, \"IngestionRole\", {\n assumedBy: new ServicePrincipal(\"redshift.amazonaws.com\"),\n managedPolicies: [\n ManagedPolicy.fromAwsManagedPolicyName(\"AmazonRedshiftAllCommandsFullAccess\")\n ]\n })\n \n bucket.grantRead(ingestionRole)\n \n const namespace = new dsf.consumption.RedshiftServerlessNamespace(this, 'DefaultRedshiftServerlessNamespace', {\n name: \"default\",\n dbName: 'defaultdb',\n })\n /// !show\n const workgroup = new dsf.consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", {\n name: \"default\",\n namespace: namespace,\n })\n\n // Run a custom SQL to create a customer table\n const createTable = workgroup.runCustomSQL('CreateCustomerTable', \"defaultdb\", \n `\n CREATE TABLE customer(\n customer_id varchar(50), \n salutation varchar(5), \n first_name varchar(50), \n last_name varchar(50), \n email_address varchar(100)\n ) \n diststyle even\n `, \n \"drop table customer\"\n );\n\n // Run a COPY command to load data into the customer table\n const ingestion = workgroup.ingestData('ExampleCopy', \"defaultdb\", \"customer\", bucket, \"data-products/customer/\", \"csv ignoreheader 1\");\n\n // Add dependencies between Redshift Data API commands because CDK cannot infer them\n ingestion.node.addDependency(createTable);\n\n // Create an engineering role in the defaultdb\n const dbRole = workgroup.createDbRole('EngineeringRole', 'defaultdb', 'engineering');\n\n // Grant the engineering role full access to the public schema in the defaultdb\n const dbSchema = workgroup.grantDbSchemaToRole('EngineeringGrant', 'defaultdb', 'public', 'engineering');\n\n // Enforce dependencies\n dbSchema.node.addDependency(dbRole);\n /// !hide\n }\n}\n\nconst app = new App()\nnew ExampleRedshiftServerlessWorkgroupBootstrapStack(app, \"ExampleRedshiftServerlessWorkgroupBootstrapStack\")","syntaxKindCounter":{"11":17,"15":1,"80":28,"110":1,"210":1,"211":10,"213":6,"214":1,"243":5,"244":2,"260":5,"261":5,"303":2},"fqnsFingerprint":"09f7b63c8afa668d528092a463eeeedb369f7d3b462112a4c7b988a2ee9fef50"},"09f30c37bb1bac6f756a967f3fc491277aefcb6d44b6eaf9f5ec24fe770d4d7f":{"translations":{"python":{"source":"class ExampleRedshiftServerlessWorkgroupCatalogStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n\n namespace = dsf.consumption.RedshiftServerlessNamespace(self, \"DefaultRedshiftServerlessNamespace\",\n name=\"default\",\n db_name=\"defaultdb\"\n )\n\n workgroup = dsf.consumption.RedshiftServerlessWorkgroup(self, \"DefaultRedshiftServerlessWorkgroup\",\n name=\"default\",\n namespace=namespace\n )\n\n workgroup.catalog_tables(\"RedshiftCatalog\", \"example-redshift-db\", \"defaultdb/public/%\")","version":"2"},"csharp":{"source":"class ExampleRedshiftServerlessWorkgroupCatalogStack : Stack\n{\n public ExampleRedshiftServerlessWorkgroupCatalogStack(Construct scope, string id) : base(scope, id)\n {\n\n var namespace = new Consumption.RedshiftServerlessNamespace(this, \"DefaultRedshiftServerlessNamespace\", new RedshiftServerlessNamespaceProps {\n Name = \"default\",\n DbName = \"defaultdb\"\n });\n\n var workgroup = new Consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", new RedshiftServerlessWorkgroupProps {\n Name = \"default\",\n Namespace = namespace\n });\n\n workgroup.CatalogTables(\"RedshiftCatalog\", \"example-redshift-db\", \"defaultdb/public/%\");\n }\n}","version":"1"},"java":{"source":"public class ExampleRedshiftServerlessWorkgroupCatalogStack extends Stack {\n public ExampleRedshiftServerlessWorkgroupCatalogStack(Construct scope, String id) {\n super(scope, id);\n\n RedshiftServerlessNamespace namespace = RedshiftServerlessNamespace.Builder.create(this, \"DefaultRedshiftServerlessNamespace\")\n .name(\"default\")\n .dbName(\"defaultdb\")\n .build();\n\n RedshiftServerlessWorkgroup workgroup = RedshiftServerlessWorkgroup.Builder.create(this, \"DefaultRedshiftServerlessWorkgroup\")\n .name(\"default\")\n .namespace(namespace)\n .build();\n\n workgroup.catalogTables(\"RedshiftCatalog\", \"example-redshift-db\", \"defaultdb/public/%\");\n }\n}","version":"1"},"go":{"source":"type exampleRedshiftServerlessWorkgroupCatalogStack struct {\n\tstack\n}\n\nfunc newExampleRedshiftServerlessWorkgroupCatalogStack(scope construct, id *string) *exampleRedshiftServerlessWorkgroupCatalogStack {\n\tthis := &exampleRedshiftServerlessWorkgroupCatalogStack{}\n\tnewStack_Override(this, scope, id)\n\n\tnamespace := consumption.NewRedshiftServerlessNamespace(this, jsii.String(\"DefaultRedshiftServerlessNamespace\"), &RedshiftServerlessNamespaceProps{\n\t\tName: jsii.String(\"default\"),\n\t\tDbName: jsii.String(\"defaultdb\"),\n\t})\n\n\tworkgroup := consumption.NewRedshiftServerlessWorkgroup(this, jsii.String(\"DefaultRedshiftServerlessWorkgroup\"), &RedshiftServerlessWorkgroupProps{\n\t\tName: jsii.String(\"default\"),\n\t\tNamespace: namespace,\n\t})\n\n\tworkgroup.CatalogTables(jsii.String(\"RedshiftCatalog\"), jsii.String(\"example-redshift-db\"), jsii.String(\"defaultdb/public/%\"))\n\treturn this\n}","version":"1"},"$":{"source":"class ExampleRedshiftServerlessWorkgroupCatalogStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n\n const namespace = new dsf.consumption.RedshiftServerlessNamespace(this, 'DefaultRedshiftServerlessNamespace', {\n name: \"default\",\n dbName: 'defaultdb',\n })\n\n const workgroup = new dsf.consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", {\n name: \"default\",\n namespace: namespace,\n })\n\n workgroup.catalogTables('RedshiftCatalog', \"example-redshift-db\", 'defaultdb/public/%')\n }\n}","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/aws-data-solutions-framework.consumption"},"field":{"field":"markdown","line":151}},"didCompile":true,"fqnsReferenced":["@cdklabs/aws-data-solutions-framework.consumption","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespaceProps","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#catalogTables","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroupProps","aws-cdk-lib.Stack","constructs.Construct"],"fullSource":"import { App, Stack } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport * as dsf from '../../index';\n\n/// !show\nclass ExampleRedshiftServerlessWorkgroupCatalogStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n \n const namespace = new dsf.consumption.RedshiftServerlessNamespace(this, 'DefaultRedshiftServerlessNamespace', {\n name: \"default\",\n dbName: 'defaultdb',\n })\n \n const workgroup = new dsf.consumption.RedshiftServerlessWorkgroup(this, \"DefaultRedshiftServerlessWorkgroup\", {\n name: \"default\",\n namespace: namespace,\n })\n \n workgroup.catalogTables('RedshiftCatalog', \"example-redshift-db\", 'defaultdb/public/%')\n }\n}\n/// !hide\nconst app = new App()\nnew ExampleRedshiftServerlessWorkgroupCatalogStack(app, \"ExampleRedshiftServerlessWorkgroupCatalogStack\")","syntaxKindCounter":{"11":8,"80":22,"108":1,"110":2,"154":1,"169":2,"176":1,"183":1,"210":2,"211":5,"213":2,"214":2,"233":1,"241":1,"243":2,"244":2,"260":2,"261":2,"263":1,"298":1,"303":4},"fqnsFingerprint":"388aee7d95195897e52f24e04ea0cb2104b17cef1e84695dc0d2b55474bf1b41"},"47bd6a90f477caa045b8a766fcb20850980b587aa1756d503953dbdb523a2b80":{"translations":{"python":{"source":"class ExampleRedshiftDataSharingSameAccountStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n\n db_name = \"defaultdb\"\n\n producer_namespace = RedshiftServerlessNamespace(self, \"ProducerNamespace\",\n name=\"producer-namespace\",\n db_name=db_name\n )\n\n producer_workgroup = RedshiftServerlessWorkgroup(self, \"ProducerRSWorkgroup\",\n name=\"producer-workgroup\",\n namespace=producer_namespace\n )\n\n consumer_namespace = RedshiftServerlessNamespace(self, \"ConsumerNamespace\",\n name=\"consumer-namespace\",\n db_name=db_name\n )\n\n consumer_workgroup = RedshiftServerlessWorkgroup(self, \"ConsumerRSWorkgroup\",\n name=\"consumer-workgroup\",\n namespace=consumer_namespace\n )\n\n share_name = \"testshare\"\n\n create_customers_table = producer_workgroup.run_custom_sQL(\"CreateCustomerTable\", db_name, \"create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)\", \"drop table public.customers\")\n\n new_share = producer_workgroup.create_share(\"producer-share\", db_name, share_name, \"public\", [\"public.customers\"])\n new_share.new_share_custom_resource.node.add_dependency(create_customers_table)\n\n grant_to_consumer = producer_workgroup.grant_access_to_share(\"GrantToConsumer\", new_share, consumer_namespace.namespace_id)\n\n grant_to_consumer.resource.node.add_dependency(new_share)\n grant_to_consumer.resource.node.add_dependency(consumer_namespace)\n\n consume_share = consumer_workgroup.create_database_from_share(\"consume-datashare\", \"db_from_share\", share_name, producer_namespace.namespace_id)\n\n consume_share.resource.node.add_dependency(grant_to_consumer)","version":"2"},"csharp":{"source":"class ExampleRedshiftDataSharingSameAccountStack : Stack\n{\n public ExampleRedshiftDataSharingSameAccountStack(Construct scope, string id) : base(scope, id)\n {\n\n var dbName = \"defaultdb\";\n\n var producerNamespace = new RedshiftServerlessNamespace(this, \"ProducerNamespace\", new RedshiftServerlessNamespaceProps {\n Name = \"producer-namespace\",\n DbName = dbName\n });\n\n var producerWorkgroup = new RedshiftServerlessWorkgroup(this, \"ProducerRSWorkgroup\", new RedshiftServerlessWorkgroupProps {\n Name = \"producer-workgroup\",\n Namespace = producerNamespace\n });\n\n var consumerNamespace = new RedshiftServerlessNamespace(this, \"ConsumerNamespace\", new RedshiftServerlessNamespaceProps {\n Name = \"consumer-namespace\",\n DbName = dbName\n });\n\n var consumerWorkgroup = new RedshiftServerlessWorkgroup(this, \"ConsumerRSWorkgroup\", new RedshiftServerlessWorkgroupProps {\n Name = \"consumer-workgroup\",\n Namespace = consumerNamespace\n });\n\n var shareName = \"testshare\";\n\n var createCustomersTable = producerWorkgroup.RunCustomSQL(\"CreateCustomerTable\", dbName, \"create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)\", \"drop table public.customers\");\n\n var newShare = producerWorkgroup.CreateShare(\"producer-share\", dbName, shareName, \"public\", new [] { \"public.customers\" });\n newShare.NewShareCustomResource.Node.AddDependency(createCustomersTable);\n\n var grantToConsumer = producerWorkgroup.GrantAccessToShare(\"GrantToConsumer\", newShare, consumerNamespace.NamespaceId);\n\n grantToConsumer.Resource.Node.AddDependency(newShare);\n grantToConsumer.Resource.Node.AddDependency(consumerNamespace);\n\n var consumeShare = consumerWorkgroup.CreateDatabaseFromShare(\"consume-datashare\", \"db_from_share\", shareName, producerNamespace.NamespaceId);\n\n consumeShare.Resource.Node.AddDependency(grantToConsumer);\n }\n}","version":"1"},"java":{"source":"public class ExampleRedshiftDataSharingSameAccountStack extends Stack {\n public ExampleRedshiftDataSharingSameAccountStack(Construct scope, String id) {\n super(scope, id);\n\n String dbName = \"defaultdb\";\n\n RedshiftServerlessNamespace producerNamespace = RedshiftServerlessNamespace.Builder.create(this, \"ProducerNamespace\")\n .name(\"producer-namespace\")\n .dbName(dbName)\n .build();\n\n RedshiftServerlessWorkgroup producerWorkgroup = RedshiftServerlessWorkgroup.Builder.create(this, \"ProducerRSWorkgroup\")\n .name(\"producer-workgroup\")\n .namespace(producerNamespace)\n .build();\n\n RedshiftServerlessNamespace consumerNamespace = RedshiftServerlessNamespace.Builder.create(this, \"ConsumerNamespace\")\n .name(\"consumer-namespace\")\n .dbName(dbName)\n .build();\n\n RedshiftServerlessWorkgroup consumerWorkgroup = RedshiftServerlessWorkgroup.Builder.create(this, \"ConsumerRSWorkgroup\")\n .name(\"consumer-workgroup\")\n .namespace(consumerNamespace)\n .build();\n\n String shareName = \"testshare\";\n\n CustomResource createCustomersTable = producerWorkgroup.runCustomSQL(\"CreateCustomerTable\", dbName, \"create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)\", \"drop table public.customers\");\n\n RedshiftNewShareProps newShare = producerWorkgroup.createShare(\"producer-share\", dbName, shareName, \"public\", List.of(\"public.customers\"));\n newShare.newShareCustomResource.node.addDependency(createCustomersTable);\n\n RedshiftDataSharingGrantedProps grantToConsumer = producerWorkgroup.grantAccessToShare(\"GrantToConsumer\", newShare, consumerNamespace.getNamespaceId());\n\n grantToConsumer.resource.node.addDependency(newShare);\n grantToConsumer.resource.node.addDependency(consumerNamespace);\n\n RedshiftDataSharingCreateDbFromShareProps consumeShare = consumerWorkgroup.createDatabaseFromShare(\"consume-datashare\", \"db_from_share\", shareName, producerNamespace.getNamespaceId());\n\n consumeShare.resource.node.addDependency(grantToConsumer);\n }\n}","version":"1"},"go":{"source":"type exampleRedshiftDataSharingSameAccountStack struct {\n\tstack\n}\n\nfunc newExampleRedshiftDataSharingSameAccountStack(scope construct, id *string) *exampleRedshiftDataSharingSameAccountStack {\n\tthis := &exampleRedshiftDataSharingSameAccountStack{}\n\tnewStack_Override(this, scope, id)\n\n\tdbName := \"defaultdb\"\n\n\tproducerNamespace := lib.NewRedshiftServerlessNamespace(this, jsii.String(\"ProducerNamespace\"), &RedshiftServerlessNamespaceProps{\n\t\tName: jsii.String(\"producer-namespace\"),\n\t\tDbName: jsii.String(DbName),\n\t})\n\n\tproducerWorkgroup := lib.NewRedshiftServerlessWorkgroup(this, jsii.String(\"ProducerRSWorkgroup\"), &RedshiftServerlessWorkgroupProps{\n\t\tName: jsii.String(\"producer-workgroup\"),\n\t\tNamespace: producerNamespace,\n\t})\n\n\tconsumerNamespace := lib.NewRedshiftServerlessNamespace(this, jsii.String(\"ConsumerNamespace\"), &RedshiftServerlessNamespaceProps{\n\t\tName: jsii.String(\"consumer-namespace\"),\n\t\tDbName: jsii.String(DbName),\n\t})\n\n\tconsumerWorkgroup := lib.NewRedshiftServerlessWorkgroup(this, jsii.String(\"ConsumerRSWorkgroup\"), &RedshiftServerlessWorkgroupProps{\n\t\tName: jsii.String(\"consumer-workgroup\"),\n\t\tNamespace: consumerNamespace,\n\t})\n\n\tshareName := \"testshare\"\n\n\tcreateCustomersTable := producerWorkgroup.RunCustomSQL(jsii.String(\"CreateCustomerTable\"), dbName, jsii.String(\"create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)\"), jsii.String(\"drop table public.customers\"))\n\n\tnewShare := producerWorkgroup.CreateShare(jsii.String(\"producer-share\"), dbName, shareName, jsii.String(\"public\"), []*string{\n\t\tjsii.String(\"public.customers\"),\n\t})\n\tnewShare.NewShareCustomResource.Node.AddDependency(createCustomersTable)\n\n\tgrantToConsumer := producerWorkgroup.GrantAccessToShare(jsii.String(\"GrantToConsumer\"), newShare, consumerNamespace.NamespaceId)\n\n\tgrantToConsumer.Resource.Node.AddDependency(newShare)\n\tgrantToConsumer.Resource.Node.AddDependency(consumerNamespace)\n\n\tconsumeShare := consumerWorkgroup.CreateDatabaseFromShare(jsii.String(\"consume-datashare\"), jsii.String(\"db_from_share\"), shareName, producerNamespace.NamespaceId)\n\n\tconsumeShare.Resource.Node.AddDependency(grantToConsumer)\n\treturn this\n}","version":"1"},"$":{"source":"class ExampleRedshiftDataSharingSameAccountStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n\n const dbName = 'defaultdb';\n\n const producerNamespace = new RedshiftServerlessNamespace(this, 'ProducerNamespace', {\n name: 'producer-namespace',\n dbName\n });\n\n const producerWorkgroup = new RedshiftServerlessWorkgroup(this, 'ProducerRSWorkgroup', {\n name: 'producer-workgroup',\n namespace: producerNamespace\n });\n\n const consumerNamespace = new RedshiftServerlessNamespace(this, 'ConsumerNamespace', {\n name: 'consumer-namespace',\n dbName\n });\n\n const consumerWorkgroup = new RedshiftServerlessWorkgroup(this, 'ConsumerRSWorkgroup', {\n name: 'consumer-workgroup',\n namespace: consumerNamespace\n });\n\n const shareName = 'testshare';\n\n const createCustomersTable = producerWorkgroup.runCustomSQL('CreateCustomerTable', dbName, 'create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)', 'drop table public.customers');\n\n const newShare = producerWorkgroup.createShare('producer-share', dbName, shareName, 'public', ['public.customers']);\n newShare.newShareCustomResource.node.addDependency(createCustomersTable);\n\n const grantToConsumer = producerWorkgroup.grantAccessToShare('GrantToConsumer', newShare, consumerNamespace.namespaceId)\n\n grantToConsumer.resource.node.addDependency(newShare);\n grantToConsumer.resource.node.addDependency(consumerNamespace);\n\n const consumeShare = consumerWorkgroup.createDatabaseFromShare('consume-datashare', 'db_from_share', shareName, producerNamespace.namespaceId)\n\n consumeShare.resource.node.addDependency(grantToConsumer);\n }\n}","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/aws-data-solutions-framework.consumption"},"field":{"field":"markdown","line":187}},"didCompile":true,"fqnsReferenced":["@cdklabs/aws-data-solutions-framework.consumption.RedshiftDataSharingCreateDbFromShareProps","@cdklabs/aws-data-solutions-framework.consumption.RedshiftDataSharingCreateDbFromShareProps#resource","@cdklabs/aws-data-solutions-framework.consumption.RedshiftDataSharingGrantedProps","@cdklabs/aws-data-solutions-framework.consumption.RedshiftDataSharingGrantedProps#resource","@cdklabs/aws-data-solutions-framework.consumption.RedshiftNewShareProps","@cdklabs/aws-data-solutions-framework.consumption.RedshiftNewShareProps#newShareCustomResource","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespace#namespaceId","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessNamespaceProps","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#createDatabaseFromShare","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#createShare","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#grantAccessToShare","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroup#runCustomSQL","@cdklabs/aws-data-solutions-framework.consumption.RedshiftServerlessWorkgroupProps","aws-cdk-lib.CustomResource","aws-cdk-lib.Stack","constructs.Construct","constructs.Construct#node","constructs.IDependable","constructs.Node#addDependency"],"fullSource":"import { App, Stack } from \"aws-cdk-lib\";\nimport { Construct } from \"constructs\";\nimport { RedshiftServerlessNamespace, RedshiftServerlessWorkgroup } from \"../lib\";\n/// !show\nclass ExampleRedshiftDataSharingSameAccountStack extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id)\n\n const dbName = 'defaultdb';\n\n const producerNamespace = new RedshiftServerlessNamespace(this, 'ProducerNamespace', {\n name: 'producer-namespace',\n dbName\n });\n \n const producerWorkgroup = new RedshiftServerlessWorkgroup(this, 'ProducerRSWorkgroup', {\n name: 'producer-workgroup',\n namespace: producerNamespace\n });\n\n const consumerNamespace = new RedshiftServerlessNamespace(this, 'ConsumerNamespace', {\n name: 'consumer-namespace',\n dbName\n });\n \n const consumerWorkgroup = new RedshiftServerlessWorkgroup(this, 'ConsumerRSWorkgroup', {\n name: 'consumer-workgroup',\n namespace: consumerNamespace\n });\n \n const shareName = 'testshare';\n\n const createCustomersTable = producerWorkgroup.runCustomSQL('CreateCustomerTable', dbName, 'create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)', 'drop table public.customers');\n\n const newShare = producerWorkgroup.createShare('producer-share', dbName, shareName, 'public', ['public.customers']);\n newShare.newShareCustomResource.node.addDependency(createCustomersTable);\n \n const grantToConsumer = producerWorkgroup.grantAccessToShare('GrantToConsumer', newShare, consumerNamespace.namespaceId)\n \n grantToConsumer.resource.node.addDependency(newShare);\n grantToConsumer.resource.node.addDependency(consumerNamespace);\n \n const consumeShare = consumerWorkgroup.createDatabaseFromShare('consume-datashare', 'db_from_share', shareName, producerNamespace.namespaceId)\n \n consumeShare.resource.node.addDependency(grantToConsumer);\n }\n}\n/// !hide\nconst app = new App()\nnew ExampleRedshiftDataSharingSameAccountStack(app, \"ExampleRedshiftDataSharingSameAccountStack\")","syntaxKindCounter":{"11":19,"80":68,"108":1,"110":4,"154":1,"169":2,"176":1,"183":1,"209":1,"210":4,"211":18,"213":9,"214":4,"233":1,"241":1,"243":10,"244":5,"260":10,"261":10,"263":1,"298":1,"303":6,"304":2},"fqnsFingerprint":"9f85cff2a9188ada126d660e05ac9a6a26a904908de5d2267dd6b2365c38a8ea"},"4de4542700e171ed78ef801e47a40d55236c3eda5c81c655c7b2226d98bd90c8":{"translations":{"python":{"source":"class ExampleRedshiftDataSharingCrossAccountAStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n\n db_name = \"defaultdb\"\n\n producer_namespace = RedshiftServerlessNamespace(self, \"ProducerNamespace\",\n name=\"producer-namespace\",\n db_name=db_name\n )\n\n producer_workgroup = RedshiftServerlessWorkgroup(self, \"ProducerRSWorkgroup\",\n name=\"producer-workgroup\",\n namespace=producer_namespace\n )\n\n share_name = \"testshare\"\n\n create_customers_table = producer_workgroup.run_custom_sQL(\"CreateCustomerTable\", db_name, \"create table public.customers (id varchar(100) not null, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null)\", \"drop table public.customers\")\n\n new_share = producer_workgroup.create_share(\"producer-share\", db_name, share_name, \"public\", [\"public.customers\"])\n new_share.new_share_custom_resource.node.add_dependency(create_customers_table)\n\n grant_to_consumer = producer_workgroup.grant_access_to_share(\"GrantToConsumer\", new_share, undefined, \"<CONSUMER-ACCOUNT-ID>\", True)\n\n grant_to_consumer.resource.node.add_dependency(new_share)\n\nclass ExampleRedshiftDataSharingCrossAccountBStack(Stack):\n def __init__(self, scope, id):\n super().__init__(scope, id)\n\n db_name = \"defaultdb\"\n\n consumer_namespace = RedshiftServerlessNamespace(self, \"ConsumerNamespace\",\n name=\"consumer-namespace\",\n db_name=db_name\n )\n\n consumer_workgroup = RedshiftServerlessWorkgroup(self, \"ConsumerRSWorkgroup\",\n name=\"consumer-workgroup\",\n namespace=consumer_namespace\n )\n\n share_name = \"testshare\"\n\n consumer_workgroup.create_database_from_share(\"consume-datashare\", \"db_from_share\", share_name, \"<PRODUCER NAMESPACE>\", \"<PRODUCER ACCOUNT>\")","version":"2"},"csharp":{"source":"class ExampleRedshiftDataSharingCrossAccountAStack : Stack\n{\n public ExampleRedshiftDataSharingCrossAccountAStack(Construct scope, string id) : base(scope, id)\n {\n\n var dbName = \"defaultdb\";\n\n var producerNamespace = new RedshiftServerlessNamespace(this, \"ProducerNamespace\", new RedshiftServerlessNamespaceProps {\n Name = \"producer-namespace\",\n DbName = dbName\n });\n\n var producerWorkgroup = new RedshiftServerlessWorkgroup(th