Cloud Security Programming for Practical Use (AWS, Python, Terraform)
It is configured to allow you to learn programming languages (Python, Terraform) for the cloud. You can directly create and apply simple yet tedious repetitive tasks, track when and how you deployed, and implement your company's unique policies that specific solutions cannot address. Specifically, we will apply a security architecture using Terraform, the most popular IaC (Infrastructure as Code) application, and also proceed with creating an ultra-simple dashboard using Python!
653 learners
Level Basic
Course period Unlimited

Announcement of new features (Mocks) and major changes in Terraform 1.7
hello.
This is Kangmin Cheon, a cloud programming instructor who uses it in practice.
Terraform version 1.7 has been released. You can see the related announcement here .
There has been a bigger change (and more stressful) than I thought.
The order in which modules are deleted after testing changes.
existing
Main state file
Status files for each module (in reverse order)
So when writing tests referencing modules, there is no dependency on resources loaded into the main state file.
change
Delete state files in reverse order of run blocks
So don't rely on resources that get deleted early.
A simple example

Previously, it was not possible to write like the above, but it is possible from 1.7.
Mocks (in beta)
Simply put, it is a function that defines and uses specific values without creating/deleting/referencing actual providers, resources, data, or modules.
After looking into it in advance, it seems that if we simply create a mock data in a distributed or generated form and put it in, testing will be possible much faster than before.
Examples are given below.
# main.tftest.hcl mock_provider "aws" { override_data { target = module.credentials.data.aws_s3_object.data_bucket values = { body = "{\"username\":\"username\",\"password\":\"password\"}" } } } run "test" { assert { condition = jsondecode(local_file.credentials_json.content).username == "username" error_message = "incorrect username" } }You can create results from data blocks and quickly test them through the run block.
Reviews for the 1.7 release
I feel really bad that I changed such important logic in just one minor version. I apologize to those who watched my lecture and made it based on the previous deletion status...
For the above reasons + since it is in beta, I plan to add more information about Mocks later when it becomes more mature and solid. However, I think it is right to share the released information anyway, so I am publishing this news.
thank you




