はじめに
IaCジェネレーターの使用感を見てみたので備忘録も兼ねて記事にしました。
スキャン
5分くらいでアカウント内のリソースを全スキャンしてくれるようです。
テンプレート作成
試しに先日構築したECSのタスク定義をテンプレート化して詳細見ていきます。
Resources:
ECSTaskDefinition00taskdefinitionecstaskdefinition200TaqkI:
UpdateReplacePolicy: "Retain"
Type: "AWS::ECS::TaskDefinition"
DeletionPolicy: "Retain"
Properties:
InferenceAccelerators: []
Memory: "3072"
PlacementConstraints: []
Cpu: "1024"
RequiresCompatibilities:
- "FARGATE"
NetworkMode: "awsvpc"
EnableFaultInjection: false
ExecutionRoleArn:
Fn::GetAtt:
- "IAMRole00ecsTaskExecutionRole00WhmYw"
- "Arn"
RuntimePlatform:
OperatingSystemFamily: "LINUX"
CpuArchitecture: "X86_64"
Volumes: []
ContainerDefinitions:
- ExtraHosts: []
Secrets: []
VolumesFrom: []
Cpu: 0
EntryPoint: []
DnsServers: []
Image: "061039782769.dkr.ecr.ap-northeast-1.amazonaws.com/h4b-ecs-helloworld:0.0.1"
Essential: true
LogConfiguration:
SecretOptions: []
Options:
awslogs-group: "/ecs/ecs-task-definition"
mode: "non-blocking"
max-buffer-size: "25m"
awslogs-create-group: "true"
awslogs-region: "ap-northeast-1"
awslogs-stream-prefix: "ecs"
LogDriver: "awslogs"
ResourceRequirements: []
EnvironmentFiles: []
Name: "apache-helloworld"
MountPoints: []
DependsOn: []
DockerLabels: {}
PortMappings:
- ContainerPort: 80
AppProtocol: "http"
Protocol: "tcp"
HostPort: 80
Name: "apache-helloworld-80-tcp"
DockerSecurityOptions: []
SystemControls: []
Command: []
DnsSearchDomains: []
Environment: []
Links: []
CredentialSpecs: []
Ulimits: []
Family: "ecs-task-definition"
Tags: []
- アップデートのポリシーがRetainに勝手になっていたので、テンプレートを修正したら上書きではなく新しくリソース作っちゃうことになりそう。Deleteに変える必要あり