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

aws_cdk.aws_glue.CfnDatabase: Glue Database create table default_permissions error #27016

Closed
csotomon opened this issue Sep 5, 2023 · 2 comments
Labels
@aws-cdk/aws-glue Related to AWS Glue

Comments

@csotomon
Copy link

csotomon commented Sep 5, 2023

Describe the bug

We're creating a new Glue Database and we want to use the create_table_default_permissions parameter of the DatabaseInputProperty class constructor as this example:

https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_glue/CfnDatabase.html#aws_cdk.aws_glue.CfnDatabase.DatabaseInputProperty.create_table_default_permissions

If we set None (default value) or another value, we always receive and error.

Expected Behavior

New database with empty "create table default permissions"

Current Behavior

Exception has occurred: TypeError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
init() got an unexpected keyword argument 'create_table_default_permissions'
File "/home/camilo/proyectos/cwp-gai-pan/IaC/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in call
inst = super(JSIIMeta, cast(JSIIMeta, cls)).call(*args, **kwargs)
File "/home/camilo/proyectos/cwp-gai-pan/IaC/cdk_stack.py", line 178, in _create_glue_database
kb_db =aws_glue.CfnDatabase(self,
File "/home/camilo/proyectos/cwp-gai-pan/IaC/cdk_stack.py", line 207, in build_template
self._kb_db = self._create_glue_database(config)
File "/home/camilo/proyectos/cwp-gai-pan/IaC/app.py", line 14, in
stack.build_template(config)
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main (Current frame)
return _run_code(code, main_globals, None,
TypeError: init() got an unexpected keyword argument 'create_table_default_permissions'

Reproduction Steps

`
from aws_cdk import aws_glue)

kb_db =aws_glue.CfnDatabase(self,
'kb-gluedb',
catalog_id=self.account,
database_input=aws_glue.CfnDatabase.DatabaseInputProperty(
name=f'{config["projectName"]}_kb'),
create_table_default_permissions = []
)
`

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.94.0 (build 987c329)

Framework Version

No response

Node.js Version

v18.17.0

OS

Ubuntu 20.04.6 LTS

Language

Python

Language Version

3.9.17

Other information

No response

@csotomon csotomon added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 5, 2023
@github-actions github-actions bot added the @aws-cdk/aws-glue Related to AWS Glue label Sep 5, 2023
@peterwoodworth peterwoodworth removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 5, 2023
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Sep 5, 2023

Works for me on latest version with the snippet from the docs

        db = glue.CfnDatabase(self, "Bucket", 
            catalog_id="Bucket",
                database_input=glue.CfnDatabase.DatabaseInputProperty(
                    create_table_default_permissions=[glue.CfnDatabase.PrincipalPrivilegesProperty(
                        permissions=["permissions"],
                        principal=glue.CfnDatabase.DataLakePrincipalProperty(
                            data_lake_principal_identifier="dataLakePrincipalIdentifier"
                        )
                    )],
                description="description",
                federated_database=glue.CfnDatabase.FederatedDatabaseProperty(
                    connection_name="connectionName",
                    identifier="identifier"
                ),
                location_uri="locationUri",
                name="name",
                target_database=glue.CfnDatabase.DatabaseIdentifierProperty(
                    catalog_id="catalogId",
                    database_name="databaseName",
                    region="region"
                )
            )
        )

Try reinstalling your packages to make sure your library is on the most recent version, that's usually why people see these errors

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-glue Related to AWS Glue
Projects
None yet
Development

No branches or pull requests

2 participants