본문 바로가기
창고

[GameDay Hands-on] AWSKRUG x HUG Seoul: Terraform Night - 2025년 3월 17일 (월)

by yeongki0944 2025. 3. 17.

https://www.meetup.com/ko-KR/awskrug/events/306490477/ 

■ 식 순서

  • 19:00-19:20: Intro
  • 19:20-20:00: Terraform on AWS GameDay (lv.100-200)
  • 20:00-20:10: Break Time
  • 20:10-20:50: Tech talk about Terraform on AWS (lv. 200 ⬆️ )
  • 20:50- : Q&A, Free Career Talk, Networking, etc

■ Intro

실시간 통역 : https://live.cuckoo.so/at/awskrug/terraform-night 
하시코프 한국사용자 모임 : https://www.facebook.com/groups/hashicorpkrug/?locale=ko_KR

연사 소개

 

 

 

Terraform 프로바이더 구조 설명

Bruno는 Terraform이 단일 도구가 아닌 분산 아키텍처를 가진 제품임을 설명했습니다. Terraform은 CLI와 프로바이더로 구성되어 있으며, 프로바이더는 AWS, Kubernetes 등 다양한 플랫폼과 상호작용하는 비즈니스 로직을 담당합니다.

"Now, I'm going to delve a bit into Terraform providers, especially if you're new to Terraform. Terraform follows a distributed product architecture, meaning we have a command line interface. Many people think of Terraform as a single tool when they first hear about it, a single CLI tool. But it actually involves multiple components. It involves a CLI that you interface with, and Terraform excels at planning and understanding what kind of resources should be created. In what order? And there should be some state of those resources. But when it comes to interacting with platforms like AWS, Kubernetes, Datadog, Azure, or Google, there is the concept of providers."

Terraform 프로바이더는 작은 RPC 서버로 작동하며, CLI와 통신합니다:

"In this case, you can see that the Terraform CLI makes requests to the AWS provider. When you're using Terraform with an AWS configuration, there are two processes running on your machine. It's the Terraform CLI binary and the RPC server from the AWS provider that are being started. You don't usually notice it, but when you work with Terraform, this is what's happening in the background."

 

AWS 프로바이더

AWS 프로바이더는 HashiCorp가 만든 첫 번째 공식 Terraform 프로바이더이며, 현재 가장 큰 Terraform 프로바이더입니다. Go 언어로 작성되었으며 AWS SDK for Go V2를 기반으로 합니다.

"The first official tariff from the provider we built. That's how we started HashiCorp. That's why we have a really good partnership with AWS as well. It's also the largest Terraform provider at the moment. We built around the AWS SDK for Go V2 within a HashiCorp environment, where everything is written in Go for a Go-only or Go-first company for the past 10-11 years."

중요한 점은 AWS 프로바이더의 코드가 수작업으로 작성되었다는 것입니다:

"So the entire code base is now wrapped around the AWS SDK for Go V2. The reason I mention this is because the AWS providers and all the contributions by the community and ourselves are handwritten. We write out those resources."

 

 

AWS Cloud Control 프로바이더

AWS CC 프로바이더는 AWS Cloud Control API를 사용하는 새로운 프로바이더입니다. Cloud Control API는 AWS의 모든 리소스를 생성, 읽기, 업데이트, 삭제할 수 있는 통일된 인터페이스를 제공합니다.

"The AWS CC provider stands for the Cloud Control API, which I'll discuss in a moment. So instead of targeting the RDS API, RDST API, or the EC2 API, it only communicates with the AWS Cloud Control API. And it works very differently, so I'll delve into that a bit. That's why it's called AWS CC. It's AWS Cloud Control API, which is why we named the provider that way."

Cloud Control API의 주요 목적과 장점:

"The AWS Cloud Control API is a service from Amazon that you can interact with using the AWS CLI, HTTP, or other methods. It's a service provided by Amazon that offers a uniform interface to create, read, update, and delete any resource in AWS, whether it's an AWS load balancer, a chatbot, an ECR repository, or an RDS database. The Cloud Control API provides a single standardized method to launch any resource in AWS."

"It provides launch day support for programmatic access. If any AWS service team builds a new feature or an entirely new service. It adds support through the AWS Cloud Control API with their API specification, allowing companies like HashiCorp to programmatically access those resources in a very consistent way."

AWS CC 프로바이더의 가장 큰 차이점은 자동 생성된다는 것입니다:

"That's also what we do here. On screen, you can see the awscc provider, which is completely auto-generated. The entire AWS provider is generated by introspecting the schema or specification from the Cloud Control API, and we turn that into code."

 

두 프로바이더를 함께 사용하기

두 프로바이더의 장점을 모두 활용하기 위해 함께 사용할 수 있습니다. AWS CC 프로바이더는 새로운 기능을 즉시 지원하지만, 기존 AWS 프로바이더는 더 안정적입니다.

"In this case, imagine we have a small network and we've created an AWS security group. However, the Security Group Egress, the resource I'm highlighting now, was only released in the AWS CC provider and wasn't supported in the AWS provider itself until now. We waited a couple of days and then magically got support in the AWS provider as well, because it's handwritten and takes some time. We wanted to adopt the egress rule on launch day, but..."

"The whole idea of the CC provider is to use it alongside the AWS provider, so you benefit from the launch support. Once the AWS provider releases support for it, you can gradually migrate those resources back into the AWS provider."

세미나의 실습 부분에서는 CC 프로바이더에서 AWS 프로바이더로 리소스를 마이그레이션하는 방법을 설명할 예정입니다:

"So that's what we're going to do today. We're going to migrate our CC resource back into the AWS provider without actually recreating that resource. This allows us to use two providers simultaneously. Benefiting from launch day support using the CC provider, but then maintaining only a single AWS provider instead of using two providers in parallel all the time."

더보기

AWS CC는 Terraform에서 사용되는 AWS Cloud Control API 제공자를 의미합니다. 이것은 기존의 AWS 제공자와는 구별되는 두 번째 AWS 제공자입니다.

AWS Cloud Control API는 Amazon에서 제공하는 통합 인터페이스로, AWS의 다양한 리소스(로드 밸런서, 챗봇, ECR 저장소, RDS 데이터베이스 등)를 생성, 읽기, 업데이트, 삭제할 수 있는 표준화된 방법을 제공합니다.

주요 특징과 차이점:

  1. 기존 AWS 제공자는 각 서비스별 API(RDS API, EC2 API 등)와 직접 통신하는 반면, AWS CC 제공자는 오직 Cloud Control API와만 통신합니다.
  2. Cloud Control API는 모든 AWS 리소스에 대해 일관되고 예측 가능한 CRUD(생성, 읽기, 업데이트, 삭제) 작업을 제공합니다.
  3. AWS CC 제공자는 API 사양의 불일치 문제를 해결하기 위해 개발되었으며, 시간이 지남에 따라 Amazon에 의해 개선되었습니다.
  4. 이 API는 주로 코드형 인프라 도구를 구축하는 기업들을 위해 설계되었으며, AWS 리소스와 상호작용하는 표준화된 방법을 제공합니다.

Terraform에서는 리소스 유형에 따라 기존 AWS 제공자나 AWS CC 제공자를 선택하여 사용할 수 있습니다.

 


AWS CC 제공자 개요

  • 테라폼에는 두 가지 AWS 제공자가 존재함: 기존 AWS 제공자와 AWS CC 제공자
  • AWS CC는 "AWS Cloud Control API"의 약자임
  • 기존 제공자는 각 서비스별 API(RDS, EC2 등)와 통신하지만, AWS CC 제공자는 오직 AWS Cloud Control API와만, 통신함

Cloud Control API 특징

  • Amazon이 제공하는 서비스로 AWS CLI, HTTP 등을 통해 상호작용 가능
  • AWS의 모든 리소스(로드 밸런서, 챗봇, ECR 저장소, RDS 데이터베이스 등)에 대한 통일된 인터페이스 제공
  • 단순화된 CRUD(생성, 읽기, 업데이트, 삭제) 작업만 제공

개발 배경 및 목적

  • 기존 AWS API들 간의 불일치 문제를 해결하기 위해 개발됨
  • Amazon이 보다 예측 가능하고 일관된 API 사양을 개발하여 수년간 개선해옴
  • 주로 개인 사용자가 아닌 HashiCorp와 같은 기업들이 코드형 인프라 도구를 구축할 때 사용하도록 설계됨

HashiCorp와 코드 생성

  • 일관된 인터페이스 덕분에 HashiCorp는 AWS 리소스에 대한 코드 생성이 용이해짐
  • 기존 AWS 제공자는 API 불일치로 인해 수작업으로 작성되었으나, AWS CC 제공자는 완전히 자동 생성됨
  • Cloud Control API의 스키마나 사양을 분석하여 코드를 자동 생성함

기타 특징

  • 다양한 AWS 리소스 지원 목록이 문서에 존재
  • 새로운 AWS 서비스나 기능이 출시될 때 프로그램 접근을 위한 지원 제공
  • 이를 통해 기업들이 일관된 방식으로 프로그래밍적으로 리소스에 접근 가능

 

 

 HashCorp Terraform GameDay

  • 스프레드시트 > 이름 > 팀이름을 사용
  • 1인 1팀
  • us-east-1만 사용가능
  • Quests 진행 시작
  • 이번 게임데이에서는 Gitea는 사용안함 
  • 먼저 맞춘사람이 더 많은 코드 / 더 좋은 코드 
  • 상위 30명 경품 

 

Team 17 f823-11fc7b-8d 1 김영기 Deployed 0:00:04 369834503152 https://catalog.us-east-1.prod.workshops.aws/join?access-code=f823-11fc7b-8d