https://pulumi.com logo
#general
Title
# general
t

tall-monitor-77779

10/16/2018, 2:33 PM
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

white-balloon-205

10/16/2018, 4:22 PM
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

tall-monitor-77779

10/16/2018, 5:01 PM
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

cold-coat-35200

10/16/2018, 6:35 PM
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

white-balloon-205

10/16/2018, 6:43 PM
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

tall-monitor-77779

10/16/2018, 7:11 PM
brilliant, thanks guys
2 Views