https://pulumi.com logo
#getting-started
Title
# getting-started
d

dry-byte-5648

08/28/2023, 7:07 AM
It seems I cannot access the url tho after it being deployed
Copy code
PS C:\Users\spork> curl <http://42dc3ff4-a889beb-35dce818edddbb9d.elb.ap-southeast-2.amazonaws.com>
curl : Unable to connect to the remote server
At line:1 char:1
+ curl <http://42dc3ff4-a889beb-35dce818edddbb9d.elb.ap-southeast-2.amaz> ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
It seems that nginx is running tho
Copy code
pulumi logs
Collecting logs for stack dev since 2023-08-28T17:57:11.000+12:00.

 2023-08-28T18:46:06.377+12:00[                  pulumi-nginx] /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
 2023-08-28T18:46:06.377+12:00[                  pulumi-nginx] /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
 2023-08-28T18:46:06.381+12:00[                  pulumi-nginx] /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
 2023-08-28T18:46:06.451+12:00[                  pulumi-nginx] 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf. 2023-08-28T18:46:06.458+12:00[                  pulumi-nginx] 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
 2023-08-28T18:46:06.458+12:00[                  pulumi-nginx] /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh  
 2023-08-28T18:46:06.459+12:00[                  pulumi-nginx] /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
 2023-08-28T18:46:06.461+12:00[                  pulumi-nginx] /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
 2023-08-28T18:46:06.468+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: using the "epoll" event method
 2023-08-28T18:46:06.468+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: nginx/1.25.2
 2023-08-28T18:46:06.468+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)       
 2023-08-28T18:46:06.468+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: OS: Linux 5.10.184-175.749.amzn2.x86_64      
 2023-08-28T18:46:06.468+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 65535:65535        
 2023-08-28T18:46:06.468+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: start worker processes
 2023-08-28T18:46:06.469+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: start worker process 29
 2023-08-28T18:46:06.469+12:00[                  pulumi-nginx] 2023/08/28 06:46:06 [notice] 1#1: start worker process 30
Update: not solved
Copy code
const cloud = require("@pulumi/cloud");
const aws = require("@pulumi/aws");

let service = new cloud.Service("pulumi-nginx", {
    containers: {
        nginx: {
            build: "./app",
            memory: 128,
            ports: [{ port: 80, protocol: 'http' }],
        },
    },
    replicas: 1
});

// export just the hostname property of the container frontend
exports.url = service.defaultEndpoint.apply(e => `http://${e.hostname}`);
Added protocol: http based of https://github.com/pulumi/pulumi-cloud/blob/master/aws/service.ts#L73 Url does start with http://internal-4 now, so maybe I'll need to expose it from the vpc? Update 2: add
external: true
to ports, which had gotten rid of the internal part, but still can't access url Update 3: Solved After destroying and rebuilding it works :)