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_glue.CfnConnection: JDBC Connection does not work without optional availability_zone param #32959

Open
1 task
Lizards opened this issue Jan 15, 2025 · 1 comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation @aws-cdk/aws-glue Related to AWS Glue bug This issue is a bug. p2

Comments

@Lizards
Copy link

Lizards commented Jan 15, 2025

Describe the bug

The availability_zone param is optional for aws_glue.CfnConnection.PhysicalConnectionRequirementsProperty. A Connection resource is successfully created without it. However, "Test Connection" in the AWS Console fails with a cryptic error: InvalidInputException: Unable to resolve any valid connection

I noticed the Connection would work if I saved it in the AWS Console without changes. There is no field for Availability Zone in the UI, but the parameter is present in the network request when a Connection is saved. Inspecting that network request was the only way I was able to narrow down the problem. "Test Connection" worked after I added this optional param in CDK.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I would expect failure to create the resource if it's not valid, or the value to be set on behalf of the user as it is in the AWS console, or a more actionable error message in the AWS Console.

Current Behavior

A nonfunctional resource is created without an obvious path to troubleshoot.

Reproduction Steps

aws_glue.CfnConnection(
    self,
    "some_connection_id",
    catalog_id="some_catalog_id",
    connection_input=aws_glue.CfnConnection.ConnectionInputProperty(
        name="some jdbc connection",
        connection_type="JDBC",
        connection_properties={
            "JDBC_CONNECTION_URL": "jdbc:mysql://some-cluster.us-west-2.rds.amazonaws.com:3306/some_database",
            "JDBC_ENFORCE_SSL": False,
            "SECRET_ID": "some_secret_id",
        },
        physical_connection_requirements=aws_glue.CfnConnection.PhysicalConnectionRequirementsProperty(
            availability_zone="us-west-2a",   # <-- here
            subnet_id="some_subnet_id",
            security_group_id_list=["some_security_group_id"],
        ),
    ),
)

Possible Solution

  • CloudFormation fails to create an invalid Connection resource, or
  • Make availability_zone required, or
  • Populate the value on behalf of the user like the AWS Console does, or
  • Mention this somewhere in the documentation/docstrings, or
  • Provide a more actionable error message

Additional Information/Context

No response

CDK CLI Version

2.149.0 (build c8e5924)

Framework Version

No response

Node.js Version

18.15.0

OS

macOS

Language

Python

Language Version

No response

Other information

No response

@Lizards Lizards added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 15, 2025
@github-actions github-actions bot added the @aws-cdk/aws-glue Related to AWS Glue label Jan 15, 2025
@khushail
Copy link
Contributor

khushail commented Jan 16, 2025

Hi @Lizards , thanks for reaching out. Looks like this issue is related to L1 construct , so you might need to create an issue with the cloudformation team here -https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues.
Let me know if you need any other guidance.

Thanks.

@khushail khushail added p2 @aws-cdk/aws-cloudformation Related to AWS CloudFormation and removed needs-triage This issue or PR still needs to be triaged. labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation @aws-cdk/aws-glue Related to AWS Glue bug This issue is a bug. p2
Projects
None yet
Development

No branches or pull requests

2 participants