limited-carpenter-34991
05/27/2020, 1:43 PMvar resourceGroup = new ResourceGroup("resourceBla", new ResourceGroupArgs,
new CustomResourceOptions
{
ImportId = "/subscriptions/4711/resourceGroups/resourceBla"
});
azure:core:ResourceGroup resourceBla import [diff: ~name]; 1 warning
ancient-megabyte-79588
05/27/2020, 2:08 PMconst resourceGroup = azure.core.ResourceGroup.get(resourceGroupName, resouceGroupId);
and this command with the import
directive will import it and put it under stack management.
let server = new aws.ec2.Instance("web-server", {
ami: "ami-6869aa05",
instanceType: "t2.micro",
securityGroups: [ group.name ],
}, { import: "i-06a1073de86f4adef" });
https://www.pulumi.com/docs/intro/concepts/programming-model/#importlimited-carpenter-34991
05/27/2020, 2:39 PMBecause of auto-naming, it is common to run into this when importing a resource’s name property. Unless you explicitly specify a name, Pulumi will auto-generate one, which is guaranteed not to match, because it will have a random hex suffix. To fix this problem, explicitly specify the resource’s name as described here. Notice that has been done in the above example for the EC2 security group, by passingas its name property in its arguments."web-sg-62a569b"