hey, say I have an existing AWS resource (prior to...
# general
t
hey, say I have an existing AWS resource (prior to deploying with pulumi) and I want to manage it with pulumi, specific case being I want to enable flow logs on a VPC resource, how would I do this? ie. without to risk of overwriting existing configuration
w
This is possible using a manual process currently - we are tracking making this really easy as part of https://github.com/pulumi/pulumi/issues/1662.
For now - check out the guidance at https://pulumi-community.slack.com/archives/C84L4E3N1/p1538054214000100. We'll make sure to get that into the issue or an FAQ soon.
t
thanks @white-balloon-205 seems to make sense, but any pointers on the first part
Use '.get' methods and do a deployment to read the resource into the checkpoint file.
?
c
I think he refers to the get methods on the aws resources, like this: https://pulumi.io/reference/pkg/nodejs/@pulumi/aws/ec2/#Vpc
w
That's right - something like:
Copy code
const cluster = aws.eks.Cluster.get("mycluster", "eksCluster-4606f9f");
That gets an initialized instance of a Cluster and stores it in the checkpoint file. If you
pulumi stack export > stack.json
you'll see:
Copy code
{
                "urn": "urn:pulumi:gettest-dev::gettest::aws:eks/cluster:Cluster::mycluster",
                "custom": true,
                "id": "eksCluster-4606f9f",
                "type": "aws:eks/cluster:Cluster",
                "outputs": {
                    ...
                },
                "parent": "urn:pulumi:gettest-dev::gettest::pulumi:pulumi:Stack::gettest-gettest-dev",
                "external": true,
                "dependencies": null,
                "initErrors": null,
                "provider": "urn:pulumi:gettest-dev::gettest::pulumi:providers:aws::default::3c21fdf5-0031-4f19-9576-838e47b613fb"
            }
Note the
external: true
- which indicates this is not managed by Pulumi.
t
brilliant, thanks guys