Hey guys, Quick question, i'm trying to deploy a G...
# aws
a
Hey guys, Quick question, i'm trying to deploy a Glue data catalog table with pulumi (using python deployment). I'm creating a glue schema, and i cant figure out how to base my table on the schema inside pulumi. how can i use the supporting types that are seen in the documenation?
g
Which documentation are you looking at, AWS's Glue docs or the Pulumi API docs? In a quick look at your code, I don't see the `storage_descriptor` option, which gets a schema_reference in the
CatalogTableStorageDescriptor
that, if you continue to follow that down in the API, leads you to the schema_arn, which is where you reference the schema you created. That's how you get the schema in. So the second call would look something like this (note that I haven't tested this, so you might need to modify it):
Copy code
aws_glue_catalog_table = aws.glue.CatalogTable(...,
  storage_descriptor=aws.glue.CatalogTable.CatalogTableStorageDescriptorArgs(.....,
    schema_reference=aws.glue.CatalogTable.CatalogTableStorageDescriptorSchemaReference(
      ....,
      schema_id=aws.glue.CatalogTableStorageDescriptorSchemaReferenceSchemaID(
        ...,
        schema_arn=glue_schema_for_affected_entities.arn)
      )
  ),
  opts=...
)
👍 1
a
Hey Laura, Thanks for the quick and helpful response! After reviewing the API references and your code, I modified the code to be as follows:
Copy code
aws_glue_catalog_table = aws.glue.CatalogTable("glue-for-xm-table",
    database_name="glue-for-xm-database",
    name="glue-for-xm-table",
    storage_descriptor=aws.glue.CatalogTableStorageDescriptorArgs(
        schema_reference=aws.glue.CatalogTableStorageDescriptorSchemaReferenceArgs(
            schema_version_number=1,
            schema_id=aws.glue.CatalogTableStorageDescriptorSchemaReferenceSchemaIdArgs(
                schema_arn=glue_schema_for_affected_entities.arn
                )
        )
    ),
    opts=pulumi.ResourceOptions(depends_on=[aws_glue_catalog_database])
    )
And it works now. Thank you!
🙌 1
🎉 1
g
Yay! Happy it worked and happy to be of service!