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

CDKTF : Unable to get output for this data_aws_ssm_parameters_by_path #32044

Closed
1 task
PreranaAmirapu opened this issue Nov 7, 2024 · 2 comments
Closed
1 task
Assignees
Labels
package/tools Related to AWS CDK Tools or CLI

Comments

@PreranaAmirapu
Copy link

PreranaAmirapu commented Nov 7, 2024

Describe the bug

def get_latest_stable_release(self):
    """
    Fetches the latest release version from the specified GitHub repository.
    Returns:
        str: The latest release version.
    """
    test = data_aws_ssm_parameters_by_path.DataAwsSsmParametersByPath(
        self.terraform_stack,
        "get_ami_version",
        path="/aws/service/bottlerocket/aws-k8s-1.30/x86_64/latest/image_version",
        with_decryption=True
    )
    latest_ami_version = Fn.element(test.values, 0)

    test = TerraformOutput(self.terraform_stack, "latest_ami_version", value=Fn.element(test.values, 0))
    print("----------------------")
    latest_ami_version = test.value
    return latest_ami_version

Regression Issue

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

Last Known Working CDK Version

No response

Expected Behavior

for the above code I need the latest version which comes in the output, tried various ways to extract the output but failed, is this the correct way to write the code in cdktf

Current Behavior

error for the above code says list is empty

Reproduction Steps

from cdktf_cdktf_provider_aws import data_aws_ssm_parameters_by_path

def get_latest_stable_release(self):
    """
    Fetches the latest release version from the specified GitHub repository.
    Returns:
        str: The latest release version.
    """
    test = data_aws_ssm_parameters_by_path.DataAwsSsmParametersByPath(
        self.terraform_stack,
        "get_ami_version",
        path="/aws/service/bottlerocket/aws-k8s-1.30/x86_64/latest/image_version",
        with_decryption=True
    )
    latest_ami_version = Fn.element(test.values, 0)

    test = TerraformOutput(self.terraform_stack, "latest_ami_version", value=Fn.element(test.values, 0))
    print("----------------------")
    latest_ami_version = test.value
    return latest_ami_version

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.147.0

Framework Version

No response

Node.js Version

v22.4.1

OS

mac

Language

Python

Language Version

No response

Other information

No response

@PreranaAmirapu PreranaAmirapu added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2024
@github-actions github-actions bot added package/tools Related to AWS CDK Tools or CLI potential-regression Marking this issue as a potential regression to be checked by team member and removed potential-regression Marking this issue as a potential regression to be checked by team member labels Nov 7, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2024
@khushail
Copy link
Contributor

khushail commented Nov 7, 2024

Hi @PreranaAmirapu , thanks for reaching out. Looks like this belongs to CDK for terraform(https://github.com/hashicorp/terraform-cdk) and this aws-cdk repo handled only issus related specific to 'aws-cdk`.

Please open issue with Terraform-cdk. I am closing this one now

@khushail khushail removed investigating This issue is being investigated and/or work is in progress to resolve the issue. bug This issue is a bug. labels Nov 7, 2024
@khushail khushail closed this as completed Nov 7, 2024
Copy link

github-actions bot commented Nov 7, 2024

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

2 participants