I'm trying to import existing vpc via pulumi.
const stackName = pulumi.getStack()
var vpcName = stackName + "-defaultvpc"
console.log("CIDR Block is" + config.cidrBlock)
const envVpc = new aws.ec2.Vpc(vpcName, {
cidrBlock: config.cidrBlock,
}, {import: config.vpcId});
module.exports = {
appVpc: envVpc
}
And then I'm executing pulumi up --stack test
.
In my understanding this command just supposed to import the existing vpc into this test stack.
But during this execution, I'm getting the following error message.
error: Preview failed: refreshing urn:pulumi:test::identity::aws:ec2/vpc:Vpc::test-defaultvpc: UnauthorizedOperation: You are not authorized to perform this operation.
I've confirmed that I've all read permissions for the VPC in aws account. But unable to find out what is the exact permission pulumi requires for this operation.