sparse-intern-71089
11/16/2022, 12:16 AMbillowy-army-68599
Image
resource:
https://github.com/pulumi/pulumi-awsx/blob/ec3ee6d18087f1ac94bde9c609aadbf3ae9e4792/awsx/ecr/image.ts#L70
I guess it’s possibly localstack doesn’t support getCredentials
?refined-engine-12125
11/16/2022, 12:19 AMrefined-engine-12125
11/16/2022, 12:34 AMrefined-engine-12125
11/16/2022, 12:35 AMbillowy-army-68599
get
.
You can double check by running it outside the component, do you get the same behaviour?refined-engine-12125
11/16/2022, 4:42 PMecr.getCredentials
shows up 4 times in all of github: https://github.com/search?q=ecr.getCredentialsOutput&type=code
When you suggest running it outside the component
, I'm not sure what that means.billowy-army-68599
aws.ecr.GetCredentials
is a pulumi specific call to retrieve credentials so it won’t show up elsewhere.
When I say outside of the component, just make the call directly from your __main__.py
aws.ecr.get_credentials
instead of
image = awsx.ecr.Image(
resource_utils.get_name(awsx.ecr.Image),
repository_url=repo.url,
path=os.path.join(os.path.dirname(__file__), "..", "..", "docker", "_build"),
)
refined-engine-12125
11/16/2022, 5:25 PMpulumilocal up
on this gives the same error:
invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF
Code
import pulumi_awsx as awsx
import pulumi_aws as aws
from utils import resource_utils
# create an ecr repository in aws
repo = awsx.ecr.Repository(
resource_utils.get_name(awsx.ecr.Repository),
tags=resource_utils.tags(),
)
gcr = aws.ecr.get_credentials(registry_id=repo.repository.id)
print(f"gcr=${gcr}")
Error
Traceback (most recent call last):
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/./__main__.py", line 19, in <module>
gcr = aws.ecr.get_credentials(registry_id=repo.repository.id)
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi_aws/ecr/get_credentials.py", line 91, in get_credentials
__ret__ = pulumi.runtime.invoke('aws:ecr/getCredentials:getCredentials', __args__, opts=opts, typ=GetCredentialsResult).value
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/invoke.py", line 144, in invoke
raise invoke_error
Exception: invoke of aws:ecr/getCredentials:getCredentials failed: invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF
panic: runtime error: index out of range [0] with length 0
billowy-army-68599
refined-engine-12125
11/16/2022, 5:59 PMecr
is here:
https://github.com/localstack/localstack/blob/0221d2908307c2b00e91336aa07e608669341788/localstack/services/cloudformation/models/ecr.py#L14
# TODO: might make sense to limit this only for resources with logical id "ContainerAssetsRepository"
class ECRRepository(GenericBaseModel):
"""
This is a mock repository to support modern CDK bootstrapping templates.
It is not intended to be used with other ECR resources.
"""
From this commit: https://github.com/localstack/localstack/commit/0221d2908307c2b00e91336aa07e608669341788
I think, for our use case, localstack
is not going to work. Bummer, b/c that would have been really cool.