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

InvalidParameterType error when trying to pass repository_name to DockerImageAsset #3795

Closed
juweeks opened this issue Aug 26, 2019 · 1 comment · Fixed by #4255
Closed

InvalidParameterType error when trying to pass repository_name to DockerImageAsset #3795

juweeks opened this issue Aug 26, 2019 · 1 comment · Fixed by #4255
Assignees
Labels
@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry bug This issue is a bug.

Comments

@juweeks
Copy link

juweeks commented Aug 26, 2019

🐛 Bug Report

What is the problem?

trying to pass the ECR repository name defined in a Repository object to the DockerImageAsset repository_name attribute and receiving an error upon deployment:

Expected params.repositoryNames[0] to be a string

i'm using the inherited ecr.Repository.repository_name attribute, which should be a string, to pass to the DockerImageAsset but it says that it's not?

Reproduction Steps

        repo = ecr.Repository(
            self,
            id='repo_id',
            repository_name='my-repo',
            lifecycle_rules=[ecr.LifecycleRule(max_image_count=10)]
        )

        repo_image = ecr_assets.DockerImageAsset(
            self,
            id='repo_image_id',
            directory='repo_dir',
            repository_name=repo.repository_name
        )

$ cdk deploy

Verbose Log

my-stack-cdk-1: deploying...

 ❌  my-stack-cdk-1 failed: InvalidParameterType: Expected params.repositoryNames[0] to be a string
Expected params.repositoryNames[0] to be a string

Environment

  • CDK CLI Version: 1.5.0
  • Module Version: 1.5.0
  • OS: Amazon Linux 2
  • Language: Python

Other information

CDK is awesome! keep up the good work!

@juweeks juweeks added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 26, 2019
@NGL321 NGL321 added the @aws-cdk/aws-ecr Related to Amazon Elastic Container Registry label Aug 27, 2019
@rix0rrr rix0rrr removed the needs-triage This issue or PR still needs to be triaged. label Aug 28, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 26, 2019

Your intended scenario wouldn't be supported anyway, since asset processing happens before the repo would be deployed (so you couldn't refer to it in this way).

repository_name needs to be a literal string, and the repository would be created outside of a CloudFormation stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants