by shigemk2

当面は技術的なことしか書かない

Terraform

terraform movedブロック

state mvと同等のことをimportブロックと同じような感じでやる developer.hashicorp.com

Terraform local変数

何度も宣言できる locals { # Ids for multiple sets of EC2 instances, merged together instance_ids = concat(aws_instance.blue.*.id, aws_instance.green.*.id) } locals { # Common tags to be assigned to all resources common_tags = { Service = l…

datadog_monitor type

type (String) The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Note: The monitor type cannot be changed after a monitor is created. Valid val…

templatefile

他ファイルからテンプレートを読み込む 変数は${ ... }で囲む developer.hashicorp.com

terraform-mode

use-packageでの設定も書いてあった (use-package terraform-mode ;; if using straight ;; :straight t ;; if using package.el ;; :ensure t :custom (terraform-indent-level 4) :config (defun my-terraform-mode-init () ;; if you want to use outline…

terraform-google-modules/composer

v2はあるけどv3はない… registry.terraform.io

terraform-provider-aws 5.53.0

aws_paymentcryptography_key aws_paymentcryptography_key_alias github.com

terraform-provider-aws 5.50.0

aws_budgets_budgetのtagがメインっぽい github.com

terraform-provider-aws 5.49.0

New Data Source: aws_datazone_environment_blueprint New Resource: aws_bedrockagent_data_source New Resource: aws_datazone_domain New Resource: aws_datazone_environment_blueprint_configuration github.com

terraform-provider-aws 5.48.0

新 aws_bedrockagent_agent_knowledge_base_association resource/aws_cloudwatch_event_target force_destroy追加 resource/aws_elasticache_replication_group デフォルトタイムアウト45分延長 github.com

terraform-provider-aws 5.46.0

aws_eip_domain_name など aws_cloudformation_stackのtemplate_bodyなど、YAMLやJSONドキュメントを使用する場合にCRLFとLFが同等に扱われるようになった github.com

terraform-provider-aws 5.45.0

この辺 resource/aws_redshift_cluster: The logging argument is now deprecated. Use the aws_redshift_logging resource instead. (#36862) resource/aws_redshift_cluster: The snapshot_copy argument is now deprecated. Use the aws_redshift_snapsho…

terraform-provider-aws 5.44.0

この辺 New Data Source: aws_devopsguru_notification_channel (#36656) New Data Source: aws_devopsguru_resource_collection (#36657) New Data Source: aws_ecr_lifecycle_policy_document (#6133) New Function: trim_iam_role_path (#36723) New Reso…

terraform-provider-aws v5.43.0

m2まわりが増えてる github.com docs.aws.amazon.com

terraform-provider-aws 5.42.0

dynamodb_table_exportが出てきた dynamodb_table_importは無い。 registry.terraform.io github.com

aws_s3_bucket_replication_configurationのdelete_marker_replication

delete_marker_replicationを設定するときはfilterとpriorityを設定しなければならない delete_marker_replicationはV2設定専用であり、省略できない registry.terraform.io aws.amazon.com filter設定がない状態でdelete_marker_replicationを設定すると、…

terraform-provider-aws 5.39.0

New Data Source: aws_redshift_data_shares (#35937) New Resource: aws_apprunner_deployment (#35758) New Resource: aws_config_retention_configuration (#15136) New Resource: aws_securityhub_automation_rule (#34781) New Resource: aws_shield_pr…

terraform-provider-aws 5.38.0

aws_batch_job_definition気になる

Resource aws_dynamodb_table

特にハマるポイントはないけどimportは普通にテーブル名を指定してやれば良い import { to = aws_dynamodb_table.basic-dynamodb-table id = "GameScores" } registry.terraform.io

aws_lambda_event_source_mapping DDB

DDB用のEvent Source Mappingを設定したい場合はあらかじめDDB側でストリームを有効にしておく必要がある resource "aws_lambda_event_source_mapping" "example" { event_source_arn = aws_dynamodb_table.example.stream_arn function_name = aws_lambda_f…

aws_security_group_ruleのterraform import

Using terraform import to import Security Group Rules using the security_group_id, type, protocol, from_port, to_port, and source(s)/destination(s) (such as a cidr_block) separated by underscores (_). All parts are required. って書いてあり…

terraform-provider-aws 5.35.0

New Data Source: aws_bedrock_custom_model (#34310) New Data Source: aws_bedrock_custom_models (#34310) New Data Source: aws_ssmcontacts_rotation (#32710) New Resource: aws_bedrock_custom_model (#34310) New Resource: aws_lexv2models_slot (#…

terraform-provider-aws 5.34.0

New Resource: aws_rekognition_project New Resource: aws_route53domains_delegation_signer_record など github.com

athena_named_query

保存済みクエリだから作っても実行はされない workgroupやdatabaseがrequiredなので、depends_onした方がいいかも クエリはfileやtemplatefileで別ファイルをrequireできる resource "aws_s3_bucket" "hoge" { bucket = "tf-test" } resource "aws_kms_key" …

Invalid value for "path" parameter: no file exists

こんなふうにpath.moduleを使わないでtemplatefileを呼び出すと表題エラーが出る > templatefile("backends.tftpl", { port = 8080, ip_addrs = ["10.0.0.1", "10.0.0.2"] }) 公式にもうっすら書いてあるが、path.moduleで絶対パスにしないとエラーになるっ…

aws_s3_bucket_website_configuration

aws_s3_bucketの中でwebsiteなどを設定するのはdeprecatedなので website { index_document = "index.html" } IntelliJでGitHub Copilotを使うと、index_documentブロックをサジェストしてくれなくて困る resource "aws_s3_bucket_website_configuration" "e…

terraform-provider-aws 5.33.0

FEATURES New Data Source: aws_eks_access_entry (#35037) New Resource: aws_eks_access_entry (#35037) New Resource: aws_eks_access_policy_association (#35037) New Resource: aws_lexv2models_intent (#34891) ENHANCEMENTS data-source/aws_eks_clu…

terraform-provider-aws 5.32.0

FEATURES data-source: aws_mq_broker_engine_types (#34232) data-source: aws_msk_bootstrap_brokers (#32484) data-source: aws_verifiedpermissions_policy_store (#32204) resource: aws_ebs_fast_snapshot_restore (#35211) resource: aws_elasticache…

aws_route53_recordのaliasのzone_id

type=Aのaws_route53_recordでaliasの中のzone_idについて。 例 resource "aws_elb" "main" { name = "foobar-terraform-elb" availability_zones = ["us-east-1c"] listener { instance_port = 80 instance_protocol = "http" lb_port = 80 lb_protocol = "…

terraform-provider-aws 5.31.0

aws_lbが多め 追加 Data Source aws_polly_voices (#34916) aws_ssoadmin_application_assignments (#34796) aws_ssoadmin_principal_application_assignments (#34815) Resource aws_finspace_kx_dataview (#34828) aws_finspace_kx_scaling_group (#34832)…