0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS DevOps Agent を使ってみる (6) : Terraformでのインストール

0
Posted at

1. はじめに

  • 最近 DevOps Agentの検証をしている。マネコンからインストールしてもよいが、Terraformでリソース管理しているシステム向けに、Terraformでのインストール手順を確認する。

2. やったこと

3. 構成図

image.png

4. 手順

4.1 Terraformサーバの準備

4.2 DevOps Agentの導入

  • 手順通り、サンプルリポジトリをクローンする。
git clone https://github.com/aws-samples/sample-aws-devops-agent-terraform.git
cd sample-aws-devops-agent-terraform
  • terraform.tfvarsをexampleからコピーして、自環境に合わせて編集する。
cp terraform.tfvars.example terraform.tfvars
  • exampleから変更した箇所は以下の3つのみ。
# AWS region ⇒ リージョンを東京に変更
aws_region = "ap-northeast-1"

# Resource naming (optional - if not provided, random suffix will be used) ⇒ IAMロールなどの命名規則をランダム文字列ではなく固定にする
name_postfix = "created_by_terraform"

# Agent Space configuration ⇒ Agentスペースの名前と説明
agent_space_name        = "mksamba-agentspace-terraform"
agent_space_description = "DevOps Agent Space Created by Terraform"
  • terraform init すると、必要なプロバイダーが追加される。
    • 2026/8現在、DevOps Agentエージェントスペースの作成には、AWS Cloud Controlプロバイダー(AWSCC)が必要(標準のAWSプロバイダーが未対応)。
    • さらに、サンプルリポジトリをそのまま使うとAWSCCの他にも複数のプロバイダが追加されてしまうが、全て必要なわけではないかも。
[ec2-user@ip-10-0-0-125 sample-aws-devops-agent-terraform]$ terraform init
Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/awscc versions matching "~> 1.0"...
- Finding hashicorp/aws versions matching "~> 5.0"...
- Finding hashicorp/random versions matching "~> 3.0"...
- Finding hashicorp/archive versions matching "~> 2.0"...
- Finding hashicorp/time versions matching "~> 0.9"...
- Installing hashicorp/awscc v1.94.0...
- Installed hashicorp/awscc v1.94.0 (signed by HashiCorp)
- Installing hashicorp/aws v5.100.0...
- Installed hashicorp/aws v5.100.0 (signed by HashiCorp)
- Installing hashicorp/random v3.9.0...
- Installed hashicorp/random v3.9.0 (signed by HashiCorp)
- Installing hashicorp/archive v2.8.0...
- Installed hashicorp/archive v2.8.0 (signed by HashiCorp)
- Installing hashicorp/time v0.14.0...
- Installed hashicorp/time v0.14.0 (signed by HashiCorp)
  • 続けてterraform plan/apply を行うことで、DevOps Agentのエージェントスペース及び関連するIAMロールなどが作成される。

image.png

5. 所感

  • 2026/8時点で、AWS Cloud Controlプロバイダーが必要(標準のAWSプロバイダーが未対応)。急ぎではないので標準のAWSプロバイダーの対応を待ちたい。
  • また、DatadogやGrafana連携など、外部接続系設定の部分がTerraform未対応のため、その点でももう少し様子を見たい。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?