sparse-branch-46500
04/25/2023, 11:19 AMfromExistingIds
method is no longer available in the latest version of the awsx
library. Additionally, the aws.ec2.getVpc()
method returns a different type than what is accepted as an argument when creating an awsx.ecs.Cluster
resource.brave-planet-10645
04/25/2023, 12:21 PMsparse-branch-46500
04/25/2023, 12:28 PMvpcId
from the other stack. But new awsx.ecs.Cluster
require the whole vpc object to be passed that why I am trying to retrieve the vpc using the idbrave-planet-10645
04/25/2023, 12:31 PMclassic
module - see the readme details here: https://github.com/pulumi/pulumi-awsx#migration-from-0x-to-10sparse-branch-46500
04/25/2023, 12:32 PMnew aws.ecs.Cluster
instead of awsx
right?brave-planet-10645
04/25/2023, 12:32 PMaws.ecs.Cluster
. You use it for the service later onsparse-branch-46500
04/25/2023, 12:32 PMnetworkConfiguration: {
subnets: vpc.privateSubnetIds,
securityGroups: [securityGroup.id],
},
brave-planet-10645
04/25/2023, 12:34 PMvpc.privateSubnetIds
to the stack outputs as wellsparse-branch-46500
04/25/2023, 12:35 PMawsx.ecs.FargateService
brave-planet-10645
04/25/2023, 12:35 PMsparse-branch-46500
04/25/2023, 12:35 PMbrave-planet-10645
04/25/2023, 12:36 PMcontainerdefinitions
for the task definitions (so you don’t have to just have json you pass in)sparse-branch-46500
04/25/2023, 12:37 PMcluster?: Cluster;
not as mentioned in the documentation:
const service = new awsx.ecs.FargateService("service", {
cluster: cluster.arn,
assignPublicIp: true,
desiredCount: 2,
taskDefinitionArgs: {
container: {
image: "nginx:latest",
cpu: 512,
memory: 128,
essential: true,
portMappings: [{
targetGroup: lb.defaultTargetGroup,
}],
},
},
});
also I needed to pass subnets:[]
directly to the fargate service not as mentioned here:
networkConfiguration: {
subnets: vpc.privateSubnetIds,
securityGroups: [securityGroup.id],
},
brave-planet-10645
04/25/2023, 1:50 PMI have another question which I am not sure about: If I migrate the old code for the cluster from AWSX to AWS, will Pulumi recognize that it’s the same resource or will it destroy and create a new resource?No, you’ll need to re-import into your state. Since they’re already there, you already have a list of resources and the IDs, but it will need a bit of work your end. It’s not difficult but might be a bit time consuming. Guide to importing: https://www.pulumi.com/docs/guides/adopting/import/
sparse-branch-46500
04/26/2023, 2:25 PM