https://pulumi.com logo
Title
a

acceptable-plumber-31485

03/14/2023, 4:55 PM
Good morning. I created a load balancer with ec2 instances behind it. A new security group also got created. I manually updated the security group in EC2 console so I can test if
pulumi preview
will see the difference. I would like to see if it works the same as
terraform plan
. However, it didn't see the manual change I made. What am I doing wrong?
b

billowy-army-68599

03/14/2023, 4:58 PM
terraform refreshes by default, pulumi doesn’t. do
pulumi preview -r
a

acceptable-plumber-31485

03/14/2023, 4:58 PM
cool
wow, it found the difference πŸ™‚
is it possible to use pulumi in command line to show the diff? That way, I don't have to login to the EC2 console
b

billowy-army-68599

03/14/2023, 4:59 PM
pulumi pre -r --diff
a

acceptable-plumber-31485

03/14/2023, 5:00 PM
also, it found another diff that I didn't update
ah, it only showed 1 diff
This was the first one
(venv) ➜  iac-workshop-ec2-webservers pulumi preview -r
Previewing update (dev):
     Type                             Name                             Plan       Info
     pulumi:pulumi:Stack              iac-workshop-ec2-webservers-dev             1 warning
     β”œβ”€ aws:lb:TargetGroupAttachment  web-server-us-east-1d                       
 ~   β”œβ”€ aws:ec2:SecurityGroup         web-secgrp-sg                    update     [diff: ~ingress]
     β”œβ”€ aws:lb:TargetGroup            target-group                                
     β”œβ”€ aws:ec2:Instance              web-server-us-east-1e                       
     β”œβ”€ aws:ec2:Instance              web-server-us-east-1d                       
     β”œβ”€ aws:lb:TargetGroupAttachment  web-server-us-east-1b                       
     β”œβ”€ aws:lb:TargetGroupAttachment  web-server-us-east-1e                       
     β”œβ”€ aws:ec2:Instance              web-server-us-east-1f                       
     β”œβ”€ aws:ec2:Instance              web-server-us-east-1b                       
     β”œβ”€ aws:lb:TargetGroupAttachment  web-server-us-east-1a                       
     β”œβ”€ aws:ec2:Instance              web-server-us-east-1a                       
     β”œβ”€ aws:lb:TargetGroupAttachment  web-server-us-east-1c                       
     β”œβ”€ aws:lb:TargetGroupAttachment  web-server-us-east-1f                       
     β”œβ”€ aws:lb:Listener               listener                                    
     β”œβ”€ aws:ec2:Instance              web-server-us-east-1c                       
     └─ aws:lb:LoadBalancer           loadbalancer                                [diff: ~__defaults,enableCrossZoneLoadBalancing,subnets]
there is another diff at the bottom row
however, when I added
--diff
, it only showed the first one, the ingress
b

billowy-army-68599

03/14/2023, 5:01 PM
that’s just setting the values into state, you’ll notice it isn’t going to update the resource
a

acceptable-plumber-31485

03/14/2023, 5:01 PM
gotcha
when this happens(for us in terraform), terraform will restore the original settings. I guess pulumi will restore it too
i'll run pulumi up again
oh, the manual change I made didn't get deleted. Pulumi up didn't delete it.
Resources:
    17 unchanged

Duration: 4s
I got it working using
refresh
b

billowy-army-68599

03/14/2023, 5:15 PM
adding
-r
to
pulumi up
is required as well
a

acceptable-plumber-31485

03/14/2023, 5:18 PM
Because there is
pulumi up
and
pulumi refresh
, my experience in
terraform plan
and
terraform apply
is somewhat affecting my progress in learning pulumi. Currently at work, when we submit a merge request, our tooling called Atlantis does the terraform command behind the scene. If I will introduce pulumi to where I work(I'm sure I will because I'm loving it), what would be the Atlantis equivalent in pulumi? In a merge request, when we type
atlantis plan
in a comment section, it will run
terraform plan
or maybe it has it's own code. The output is the same. Once the merge request has been approved, we will type
atlantis apply
in the comment section, it will create the resources in AWS as well as merge the pull request.
b

billowy-army-68599

03/14/2023, 5:20 PM
There’s no comparative Atlantis like tool right now. You can achieve a similar experience using the GitHub app. Pulumi has update plans which operate similarly to terraform plan
a

acceptable-plumber-31485

03/14/2023, 5:20 PM
What about in Gitlab? We are using Gitlab.
I reached out to Gitlab Support and I told them the scenario. Hopefully to hear a solution today so I can test
ah, I see what you mean. I just found out that
pulumi refresh
didn't update the resources. When I ran
pulumi up -r
, that's only when it updated the resource.
b

billowy-army-68599

03/14/2023, 5:44 PM
there’s some integration with gitlab steps here https://www.pulumi.com/docs/guides/continuous-delivery/gitlab-ci/
a

acceptable-plumber-31485

03/14/2023, 6:02 PM
Oh cool, thanks a lot!
ah, that's the one I followed few days ago. I got it working. It's different from what I want to accomplish
in that document, we have to click a stage which will open another page in Gitlab. It shows the session in a gitlab-runner as well as commands that are in gitlab-ci.yml file being executed