busy-magazine-48939
12/13/2019, 4:29 AMTypeError: Cannot read property 'publicIp' of undefined
const sgc = new aws.ec2.SecurityGroup('sg-c', {
vpcId: vpcId,
name: `${baseTags.Prefix}-intranet-sg`,
ingress: [{
protocol: 'tcp',
fromPort: 1521,
toPort: 1521,
cidrBlocks: [`${vmaEip.publicIp}/32`],
}],
tags: baseTags
})
const vma = new aws.ec2.Instance('vm-a', {
tags: { Name: `${baseTags.Prefix}-vm-a`, ...baseTags },
instanceType: 't3.xlarge',
vpcSecurityGroupIds: [sgc.id],
ami: AMI_ID,
subnetId: subnetId,
keyName: deployer.keyName,
privateIp: VMA_IP
}, { deleteBeforeReplace: true })
const vmaEip = new aws.ec2.Eip("vm-a-eip", {
associateWithPrivateIp: vma.privateIp,
instance: vma.id,
vpc: true,
tags: baseTags
})
white-balloon-205
12/13/2019, 5:30 AMpulumi.interpolate
.
https://www.pulumi.com/docs/intro/concepts/programming-model/#outputs-and-stringsbusy-magazine-48939
12/13/2019, 7:29 AMconcat
and interpolate
but it doesn’t make any effect, still getting same errorinterpolate
works within module where EIP resource is defined, but if I try to interpolate it in another module referenced via import {} then it failsconcat(stack.getOutput('outputId'))
, however my understanding always was that getOutput()
is meant to be used for cross-stack references primarily, is my understanding wrong? Is it feasible to use stack.getOutput()
within one stack?