This message was deleted.
# getting-started
s
This message was deleted.
b
terraform refreshes by default, pulumi doesn’t. do
pulumi preview -r
a
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
pulumi pre -r --diff
a
also, it found another diff that I didn't update
ah, it only showed 1 diff
This was the first one
Copy code
(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
that’s just setting the values into state, you’ll notice it isn’t going to update the resource
a
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.
Copy code
Resources:
    17 unchanged

Duration: 4s
I got it working using
refresh
b
adding
-r
to
pulumi up
is required as well
πŸ‘ 1
a
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
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
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
there’s some integration with gitlab steps here https://www.pulumi.com/docs/guides/continuous-delivery/gitlab-ci/
a
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