witty-monitor-18849
12/15/2021, 6:47 PMTypeError: Cannot read property 'arn' of undefined
? To work around it I replace the resource output ARN with a static string but this is not ideal.witty-candle-66007
12/15/2021, 7:13 PM.apply()
to resolve the arn value before using it.
https://www.pulumi.com/docs/intro/concepts/inputs-outputs/little-cartoon-10569
12/15/2021, 7:33 PMarn
on doesn't exist. I think apply()
is unlikely to help in this case.witty-monitor-18849
12/15/2021, 7:53 PMPreviewing update (demo-inf):
Type Name Plan Info
pulumi:pulumi:Stack immersify-inf-demo-inf 1 error
+ ├─ pulumi:providers:aws eu-west-1 create
+ ├─ aws:s3:Bucket crud-service-logs-bucket create
+ ├─ aws:lb:TargetGroup crud-service-http-tg create
+ ├─ aws:ec2:SecurityGroup crud-service-ec2-sg create
+ ├─ aws:ec2:SecurityGroup crud-service-alb-sg create
+ ├─ aws:ec2:SecurityGroupRule events-rds-instance-allow-crud-service create
+ ├─ aws:ec2:SecurityGroupRule crud-service-alb-allow-http create
+ ├─ aws:ec2:SecurityGroupRule crud-service-alb-allow-healthcheck create
+ ├─ aws:ec2:SecurityGroupRule crud-service-alb-allow-https create
+ ├─ aws:lb:LoadBalancer crud-service-loadbalancer create
+ └─ aws:lb:Listener crud-service-http-redirect-listener create
Diagnostics:
pulumi:pulumi:Stack (immersify-inf-demo-inf):
error: Running program '/Users/mikaelallison/workspace/gdsgroup/immersify-inf' failed with an unhandled exception:
TypeError: Cannot read property 'arn' of undefined
at Object.<anonymous> (/Users/mikaelallison/workspace/gdsgroup/immersify-inf/lb.ts:62:34)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Module.m._compile (/Users/mikaelallison/workspace/gdsgroup/immersify-inf/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Object.require.extensions.<computed> [as .ts] (/Users/mikaelallison/workspace/gdsgroup/immersify-inf/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/Users/mikaelallison/workspace/gdsgroup/immersify-inf/route53.ts:5:1)
acmCertIreland.arn
new lb.Listener(`${crudService}-http-listener`, {
loadBalancerArn: crudServiceLoadBalancer.arn,
port: 443,
protocol: 'HTTPS',
sslPolicy: 'ELBSecurityPolicy-2016-08',
certificateArn: acmCertIreland.arn,
defaultActions: [
{
type: 'forward',
targetGroupArn: crudServiceHttpTargetGroup.arn,
},
],
}, { dependsOn: acmCertIreland })
little-cartoon-10569
12/15/2021, 8:15 PMarn
is being called on undefined
. If you're using the acmCertIreland
object elsewhere (in the same conditional branch?), then could it be crudServiceLoadBalancer or crudServiceHttpTargetGroup that is undefined?witty-monitor-18849
12/16/2021, 10:00 AMacmCertIreland
is being used elsewhere in the stack.crudServiceLoadBalancer
and crudServiceHttpTargetGroup
are to be created. See below:
export const crudServiceLoadBalancer = new lb.LoadBalancer(`${crudService}-loadbalancer`, {
name: crudService,
internal: false,
loadBalancerType: 'application',
securityGroups: [ crudServiceAlbSg.id ],
subnets: vpc.publicSubnetIds,
enableDeletionProtection: true,
accessLogs: {
bucket: crudServiceLogsBucket.bucket,
prefix: crudService,
enabled: true
}
})
export const crudServiceHttpTargetGroup = new lb.TargetGroup(`${crudService}-http-tg`, {
vpcId: vpc.id,
targetType: 'instance',
protocol: 'HTTP',
port: 8080,
deregistrationDelay: 300,
healthCheck: {
interval: 10,
timeout: 4,
path: '/actuator/health',
healthyThreshold: 2,
unhealthyThreshold: 4,
},
})
new lb.Listener(`${crudService}-http-redirect-listener`, {
loadBalancerArn: crudServiceLoadBalancer.arn,
port: 80,
protocol: 'HTTP',
defaultActions: [
{
type: 'redirect',
redirect: {
port: '443',
protocol: 'HTTPS',
statusCode: 'HTTP_301'
},
},
]
})
new lb.Listener(`${crudService}-http-listener`, {
loadBalancerArn: crudServiceLoadBalancer.arn,
port: 443,
protocol: 'HTTPS',
sslPolicy: 'ELBSecurityPolicy-2016-08',
certificateArn: acmCertIreland.arn,
defaultActions: [
{
type: 'forward',
targetGroupArn: crudServiceHttpTargetGroup.arn,
},
],
}, { dependsOn: acmCertIreland })
little-cartoon-10569
12/16/2021, 10:14 AMwitty-monitor-18849
12/16/2021, 10:50 AMlittle-cartoon-10569
12/16/2021, 6:37 PM