fierce-camera-61577
07/02/2021, 10:06 AMfierce-camera-61577
08/26/2021, 2:02 AMquaint-megabyte-77026
12/31/2021, 11:52 PMfunction createMinikubeProvider(uniqueName: string, isReplica: boolean): ProviderInit {
const provider = new k8s.Provider(uniqueName, { kubeconfig });
const namespaceName = createNamespace(uniqueName, provider);
const secretName = `gcr-io-${uniqueName}`;
namespaceName.apply(ns => {
console.log(`creating secret for namespace (${ns})`)
exec(`minikube kubectl -- create secret docker-registry --namespace ${ns} ${secretName} \
--docker-server=<http://gcr.io|gcr.io> \
--docker-username=_json_key \
--docker-password="$(cat .key/gcr-service-account.json)" \
--docker-email=any@valid.email
`);
})
return {
provider: provider,
isReplica: isReplica,
kubeconfig,
uniqueName: uniqueName,
namespaceName: namespaceName
}
}
creamy-traffic-12121
04/26/2022, 12:59 AMpulumilocal up
:
ERROR: Unable to find LocalStack endpoint for service "up"
creamy-traffic-12121
04/26/2022, 1:41 AMicy-controller-6092
04/26/2022, 6:50 AMicy-controller-6092
04/26/2022, 6:51 AMaws:lambda:LayerVersion
icy-controller-6092
04/26/2022, 6:56 AMarn::s3:::bucket
vs arn:aws:s3:::bucket
as for the lambda layer issue, I may need localstack Proicy-controller-6092
04/26/2022, 7:16 AMicy-controller-6092
04/26/2022, 11:56 AMicy-controller-6092
04/26/2022, 12:50 PMicy-controller-6092
04/27/2022, 12:03 AMicy-controller-6092
04/27/2022, 2:02 AMicy-controller-6092
04/27/2022, 2:02 AMdamp-honey-93158
04/27/2022, 9:48 AMrefined-engine-12125
11/15/2022, 8:09 PMpulumi
working with localstack
but keep getting could not validate provider configuration
errors.
Following Instructions:
β’ https://docs.localstack.cloud/integrations/pulumi/
Installed
β’ https://github.com/localstack/pulumi-local
β’ https://github.com/localstack/localstack
REPRO
Install deps
pip install localstack
pip install pulumi-local
Check versions
aws --version
aws-cli/2.8.12 Python/3.9.11 Linux/5.15.0-52-generic exe/x86_64.ubuntu.22 prompt/off
python version
/home/todd/.pyenv/versions/test-3.10.6/bin/python
pulumi version
v3.46.1
pulumilocal version
v3.46.1
Start localstack
localstack start -d
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
db15aefc28b3 localstack/localstack "docker-entrypoint.sh" About an hour ago Up About an hour (healthy) 127.0.0.1:4510-4559->4510-4559/tcp, 127.0.0.1:4566->4566/tcp, 127.0.0.1:4571->4571/tcp, 127.0.0.1:12121->12121/tcp, 5678/tcp localstack_main
Check localstack services
$ localstack status services
ββββββββββββββββββββββββββββ³ββββββββββββββ
β Service β Status β
β‘βββββββββββββββββββββββββββββββββββββββββ©
β acm β β available β
β apigateway β β available β
β cloudformation β β available β
β cloudwatch β β available β
β config β β available β
β dynamodb β β available β
β dynamodbstreams β β available β
β ec2 β β available β
β es β β available β
β events β β available β
β firehose β β available β
β iam β β available β
β kinesis β β available β
β kms β β available β
β lambda β β available β
β logs β β available β
β opensearch β β available β
β redshift β β available β
β resource-groups β β available β
β resourcegroupstaggingapi β β available β
β route53 β β available β
β route53resolver β β available β
β s3 β β available β
β s3control β β available β
β secretsmanager β β available β
β ses β β available β
β sns β β available β
β sqs β β running β
β ssm β β available β
β stepfunctions β β available β
β sts β β available β
β support β β available β
β swf β β available β
β transcribe β β available β
ββββββββββββββββββββββββββββ΄ββββββββββββββ
Create project
mkdir quickstart && cd quickstart
pulumi new aws-python
pulumilocal init
pulumilocal up
ERROR
$ pulumilocal up
Previewing update (localstack)
View Live: <https://app.pulumi.com/ToddG/blargblarg/localstack/previews/45637377-b694-4e2b-a242-27d614bd04df>
Type Name Plan Info
+ pulumi:pulumi:Stack blargblarg-localstack create 1 warning
ββ aws:s3:Bucket my-bucket 1 error
Diagnostics:
aws:s3:Bucket (my-bucket):
error: could not validate provider configuration: 1 error occurred:
* Invalid or unknown key
pulumi:pulumi:Stack (blargblarg-localstack):
warning: provider config warning: Use s3_use_path_style instead.
Further Links:
β’ https://github.com/pulumi/examples/issues/185#issuecomment-789082921
β’ https://github.com/pulumi/pulumi/issues/3546
β’ https://github.com/pulumi/pulumi/issues/4718
β’ https://github.com/pulumi/pulumi/issues/4720refined-engine-12125
11/16/2022, 12:16 AMaws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF
I have a project that is attempting to put an image into localstack's aws:ecr
However, the ecr is, for some reason, calling getCredentials
? Is there a way to stub this out so it doesn't need to make this call?
REPRO:
cd {existing project}
pulumilocal init
# remove the line with mobileanalytics in the Pulumi.localstack.yml file
pulumilocal up
CODE:
import os
import pulumi_awsx as awsx
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(),
)
# create an image and deploy to that repository
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"),
)
ERROR:
View Live: <https://app.pulumi.com/ToddG/component-project/localstack/updates/2>
Type Name Status Info
pulumi:pulumi:Stack component-project-localstack **failed (1s)** 2 errors; 2 warnings; 34 messages
+ ββ aws:kms:Alias localstack-component-project-kms-alias created (0.15s)
+ ββ aws:ssm:Parameter /localstack/component/backend_project_microservice/db_uri created (0.67s)
Diagnostics:
pulumi:pulumi:Stack (component-project-localstack):
warning: provider config warning: Use s3_use_path_style instead.
warning: provider config warning: Argument is deprecated
dockerBuild: {"context":"/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/./resources/../../docker/_build"}
error: Error: invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF
at Object.callback (/snapshot/awsx/node_modules/@pulumi/pulumi/runtime/invoke.js:141:33)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client.ts:338:26)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
at /snapshot/awsx/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
at processTicksAndRejections (node:internal/process/task_queues:78:11)
error: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/resource.py", line 608, in do_rpc_call
return monitor.RegisterResource(req)
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/grpc/_channel.py", line 946, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/grpc/_channel.py", line 849, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF"
debug_error_string = "{"created":"@1668557391.399938162","description":"Error received from peer ipv4:127.0.0.1:40907","file":"src/core/lib/surface/call.cc","file_line":966,"grpc_message":"invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF","grpc_status":2}"
>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/todd/.pulumi/bin/pulumi-language-python-exec", line 192, in <module>
loop.run_until_complete(coro)
File "/home/todd/.pyenv/versions/3.10.6/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 126, in run_in_stack
await run_pulumi_func(lambda: Stack(func))
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 51, in run_pulumi_func
await wait_for_rpcs()
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 110, in wait_for_rpcs
raise exception
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/rpc_manager.py", line 68, in rpc_wrapper
result = await rpc
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/resource.py", line 613, in do_register
resp = await asyncio.get_event_loop().run_in_executor(None, do_rpc_call)
File "/home/todd/.pyenv/versions/3.10.6/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/resource.py", line 610, in do_rpc_call
handle_grpc_error(exn)
File "/home/todd/tmp_5cuvoaql/backend-project-microservice/deploy/pulumi/venv/lib/python3.10/site-packages/pulumi/runtime/settings.py", line 273, in handle_grpc_error
raise grpc_error_to_exception(exn)
Exception: 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
goroutine 83 [running]:
<http://github.com/hashicorp/terraform-provider-aws/internal/service/ecr.dataSourceAwsEcrCredentialsRead(0xc00232fd80|github.com/hashicorp/terraform-provider-aws/internal/service/ecr.dataSourceAwsEcrCredentialsRead(0xc00232fd80>, {0x7e70e80, 0xc000dc1500})
/home/runner/go/pkg/mod/github.com/pulumi/terraform-provider-aws@v1.38.1-0.20220425115028-72c3a67ae4a7/internal/service/ecr/credentials_data_source.go:59 +0x3f6
<http://github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x9254241|github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x9254241>, {0xa33b938, 0xc0000520f8}, 0x7e70e80, {0x7e70e80, 0xc000dc1500})
/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20211230170131-3a7c83bfab87/helper/schema/resource.go:336 +0x178
<http://github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc000d5f520|github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc000d5f520>, {0xa33b938, 0xc0000520f8}, 0xc00232fd00, {0x7e70e80, 0xc000dc1500})
/home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20211230170131-3a7c83bfab87/helper/schema/resource.go:559 +0xf7
<http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.ReadDataApply({0xa49c048}|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.ReadDataApply({0xa49c048}>, {0x92ad3eb, 0x13}, {0xa43f688, 0xc00232fd00})
/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.22.1/pkg/tfshim/sdk-v2/provider.go:143 +0xc5
<http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Invoke(0xc0006a78c0|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Invoke(0xc0006a78c0>, {0xa33b9a8, 0xc00239e330}, 0xc00238a6c0)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.22.1/pkg/tfbridge/provider.go:1187 +0x799
<http://github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Invoke_Handler.func1({0xa33b9a8|github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Invoke_Handler.func1({0xa33b9a8>, 0xc00239e330}, {0x8d92900, 0xc00238a6c0})
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.31.1/proto/go/provider.pb.go:2521 +0x7b
<http://github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0xa33b9a8|github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0xa33b9a8>, 0xc00239e0c0}, {0x8d92900, 0xc00238a6c0}, 0xc0018b5ae0, 0xc002398420)
/home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x406
<http://github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Invoke_Handler({0x90f7860|github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Invoke_Handler({0x90f7860>, 0xc0006a78c0}, {0xa33b9a8, 0xc00239e0c0}, 0xc00239c240, 0xc00198b680)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.31.1/proto/go/provider.pb.go:2523 +0x138
<http://google.golang.org/grpc.(*Server).processUnaryRPC(0xc001814540|google.golang.org/grpc.(*Server).processUnaryRPC(0xc001814540>, {0xa43f8c0, 0xc0006b0680}, 0xc00239a480, 0xc001e46750, 0x112b7a60, 0x0)
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.45.0/server.go:1282 +0xccf
<http://google.golang.org/grpc.(*Server).handleStream(0xc001814540|google.golang.org/grpc.(*Server).handleStream(0xc001814540>, {0xa43f8c0, 0xc0006b0680}, 0xc00239a480, 0x0)
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.45.0/server.go:1619 +0xa2a
<http://google.golang.org/grpc.(*Server).serveStreams.func1.2()|google.golang.org/grpc.(*Server).serveStreams.func1.2()>
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.45.0/server.go:921 +0x98
created by <http://google.golang.org/grpc.(*Server).serveStreams.func1|google.golang.org/grpc.(*Server).serveStreams.func1>
/home/runner/go/pkg/mod/google.golang.org/grpc@v1.45.0/server.go:919 +0x294
Error: invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF: Error: invocation of aws:ecr/getCredentials:getCredentials returned an error: error reading from server: EOF
at Object.callback (/snapshot/awsx/node_modules/@pulumi/pulumi/runtime/invoke.js:141:33)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client.ts:338:26)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:426:34)
at Object.onReceiveStatus (/snapshot/awsx/node_modules/@grpc/grpc-js/src/client-interceptors.ts:389:48)
at /snapshot/awsx/node_modules/@grpc/grpc-js/src/call-stream.ts:276:24
at processTicksAndRejections (node:internal/process/task_queues:78:11)
Outputs:
+ alias_arn: "arn:aws:kms:us-east-1:000000000000:alias/localstack-component-project-kms-alias-6e2d695"
+ key_arn : "arn:aws:kms:us-east-1:000000000000:key/abe9dc2f-800a-4593-bb33-359d108a250a"
Resources:
+ 2 created
7 unchanged
millions-furniture-75402
01/06/2023, 2:06 PMdocker login
when using awsx with ECR?
error: Error response from daemon: Get "<https://localhost.localstack.cloud:4510/v2/>": dialing localhost.localstack.cloud:4510 static system has no HTTPS proxy: resolving host localhost.localstack.cloud: lookup localhost.localstack.cloud: no such host
How do I configure the helper method to use these parameters?
AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test aws ecr get-login-password --endpoint-url=<http://localhost:4566> --region us-east-1
000000000000-auth-token
millions-furniture-75402
01/06/2023, 2:10 PMv2
to the server...
const lambdaImage = new docker.Image(`${appName}-image`, {
build: { ... },
registry: {
server: "<http://localhost:4566/>",
username: "test",
password: "test",
},
imageName: `${appName}-image`,
});
docker:image:Image (test-app-image):
error: Error response from daemon: login attempt to <http://localhost:4566/v2/> failed with status: 404 Not Found
error: Error: ' docker login' failed with exit code 1