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

StringParameter.from_string_parameter_attributes returns 'Resource' instead of 'IStringParameter' #4982

Closed
Marty-Me opened this issue Nov 12, 2019 · 5 comments
Assignees
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. language/python Related to Python bindings needs-triage This issue or PR still needs to be triaged. p0

Comments

@Marty-Me
Copy link

Marty-Me commented Nov 12, 2019

After the 1.16.0 release of this morning the synthesizing of our infrastructure started failing.
It seems like the StringParameter.from_string_parameter_attributes method provides the wrong return type (it states IStringParameter but the actual type is Resource.

Reproduction Steps

from aws_cdk import core
from aws_cdk.aws_ssm import StringParameter
from aws_cdk.core import Stack

APP = core.App()

STACK_WITH_ISSUE = Stack(APP, 'StackWithIssue')
FAILING_SSM_PARAMETER = StringParameter.from_string_parameter_attributes(STACK_WITH_ISSUE, 'FailingSSMParameter',
                                                                         parameter_name='param-name')

print(FAILING_SSM_PARAMETER)
print(FAILING_SSM_PARAMETER.string_value)

APP.synth()

Error Log

<aws_cdk.core.Resource object at 0x1103cf9d0>
Traceback (most recent call last):
  File "infrastructure/IssueStack.py", line 12, in <module>
    print(FAILING_SSM_PARAMETER.string_value)
AttributeError: 'Resource' object has no attribute 'string_value'

Environment

  • **CLI Version : ** 1.16.2 (build 5893301)
  • **Framework Version: ** 1.16.2
  • OS : macOS Catalina version 10.15 (19A583)
  • Language : Python

This is 🐛 Bug Report

@Marty-Me Marty-Me added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 12, 2019
@Marty-Me
Copy link
Author

Marty-Me commented Nov 12, 2019

A temporary fix is using:

FAILING_SSM_PARAMETER._physical_name

@skinny85
Copy link
Contributor

Could this be a different manifestation of this: #4966 ?

@RomainMuller
Copy link
Contributor

Definitely is.

@eladb
Copy link
Contributor

eladb commented Nov 12, 2019

Sounds like Jsii. Reassigning to @RomainMuller

@eladb eladb assigned RomainMuller and unassigned eladb Nov 12, 2019
@eladb eladb added the p0 label Nov 12, 2019
@eladb
Copy link
Contributor

eladb commented Nov 12, 2019

Closing as duplicate of #4966

@eladb eladb closed this as completed Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ssm Related to AWS Systems Manager bug This issue is a bug. language/python Related to Python bindings needs-triage This issue or PR still needs to be triaged. p0
Projects
None yet
Development

No branches or pull requests

5 participants