思考の引き出しを増やすモジュール設計のヒント
※本記事は2022年1月22日に公開された記事の翻訳版です。 この記事は、Developer Productivity Engineering Campブログシリーズの一環として、Platform Infraチームの Daisuke Fujita (@dtan4)がお届けします。 メルカリでは、すべてのクラウドインフラを宣言的構成で管理することがプラットフォームの中核となる考え方の一つです。メインのクラウドプロバイダーはGoogle Cloud Platform(GCP)であり、HashiCorp Terraformを使用してインフラをコードとして管理しています。Platform Infraチームは、すべてのTerraformワークフローを安全に管理するための社内CIサービスを提供しています。 Terraformはリソースプロビジョニングのためにクラウドプロバイダーのクレデンシャルを必要と
2022/04/21_HashiCorp Virtual Strategy Day Japan Vol.2での、須藤の講演資料になります
TerraformのState TerraformのStateとは、Terraformで管理しているリソースの状態をJSONで記述したものであり、ファイルとして永続化されている。 Stateが何のためにあるのか、についてはオフィシャルな解説があるので詳しく説明はしないが、Stateには主に以下の目的がある。 Mapping to the Real World Metadata Performance Syncing このエントリでは、Performanceに着目する。 State Refresh Terraformは、plan/applyを実行する際に、どのような変更を行う必要があるのかを決定するために、リソースの最新の状態を知る必要がある。 デフォルトの動作では、plan/applyを実行するたびに、すべてのリソースの最新の状態を取得しにいく。 これがState Refreshである。
Terraform state can be managed in local file or remote file such as in AWS S3. As the resources go more and more, the state file becomes larger and the time will be longer when executing terraform apply. To make changes be applied more quickly, we can use terraform apply —-target=. Or, we could separate the state into small pieces. Move states between local files is easy. But move states between r
はじめに Infrastructure as Code(以下IaCと略します)って最近では当たり前のように実践されてますよね。特にterraformはかなりユーザが多く、開発のスピードも速い印象です。 IaCを実現できたインフラエンジニアの皆さんの多くが次に直面する問題はコードの保守運用に関する事柄ではないでしょうか? terraformもコードなので、アプリケーションのコードと同じように保守性(テスト容易性、理解容易性、変更容易性)を意識する必要があります。ただコード化しただけでは属人性を排除したとは言えないと思います。 保守性の高いterraformって具体的にどう書けばいいの?と周りに聞いてみても、巷には「ぼくのかんがえた最強のterraformベストプラクティス」が乱立していて、自転車置き場の議論になりがちです。 また、v0.12前後でterraformの記法が大きく変わったので、
Each Terraform Cloud workspace is associated with a particular Terraform configuration, which is expected to change and evolve over time. Since every organization has its own preferred source code control practices, Terraform Cloud does not provide integrated version management. Instead, it expects Terraform configurations to be managed in your existing version control system (VCS). In order to pe
terraform-at-mercari.md Terraform at Mercari 2019-11-07 State of Terraform usage All microservices-related tf codes are in one single repository Mercari JP and US are separated (but thinking to merge in the future) We have different repository for Organization management https://cloud.google.com/resource-manager/docs/creating-managing-folders Network management See more on Network Architecture Des
はじめにこんにちは、TIG DXユニット 1の木村です。 入社以降ずっと触ってきたTerraformですが、巷ではWorkspace派だったり、module派だったり、ディレクトリ完全分離派だったり、様々な流派(プラクティス)が乱立しているのを目にします。私自身ベストな構成を模索していく中で辿り着いた結論は、ケースバイケースで全てのデザインパターンに対応できる万能なものは存在しないのかな (当たり障りないですね..)ということです。 そんなわけで、様々なTerraformの流派を紹介し、各流派がどのようなパターンに向いているのか(はたまた不向きなのか)の個人的見解をまとめてみました。 ※本記事中のサンプルコードはすべて Terraform 0.12、 provider google cloud で解説してます Terraformとは?当社過去記事に解説があります。Terraformの概要や
© pexels.comA lot has been written about the benefits of immutable infrastructure. A brief version is that treating the infrastructure components as immutable helps us prevent configuration drift. After a component is deployed, it is never modified in place and can only be replaced. Some infrastructure components don’t lend themselves too well to being managed this way — it’s quite hard and probab
はじめに この記事は CrowdWorks Advent Calendar 2017 の8日目の記事です。 Terraform職人の @minamijoyo です。Infrastructure as Codeしてますか? インフラのコード管理に Terraform を使い始めて2年ちょっと、本番環境で運用していると日々色んな学びがあるので、Terraformやってみた系の入門記事では語られない、現場の運用ノウハウ的なものを共有してみようかと思います。 Terraformを使い始めた or 使っている人が、こんなときどうするの?っていうときに参考になれば幸いです。 書き始めたら超長文になりました。概要は以下のとおりです。 公式ドキュメントを読もう tfファイルを書く技術 インデントを揃える 組み込み関数に親しむ lifecycleブロックを使う リソースの差分を無視する リソース再生成のとき
This guide is meant for enterprise users looking to advance their Terraform usage from a few individuals to a full organization. For Terraform code style recommended practices, refer to the Terraform style guide. IntroductionHashiCorp specializes in helping IT organizations adopt cloud technologies. Based on what we've seen work well, we believe the best approach to provisioning is collaborative i
Terraform tips & tricks: loops, if-statements, and gotchas Image by Florian RichterUpdate, November 17, 2016: We took this blog post series, expanded it, and turned it into a book called Terraform: Up & Running! Update, July 8, 2019: We’ve updated this blog post series for Terraform 0.12 and released the 2nd edition of Terraform: Up & Running! Update, Sep 28, 2022: We’ve updated this blog post ser
Hey, I noticed that recently a bunch of people has been getting to the website through queries about HAProxy in the context of AWS - mainly how to receive traffic through a set of instances and forward them to another set of machines. As I aim at making this blog as much practical as I can, I feel that if I taught the basics around AWS networking first, then I could have the ground set for further
はじめに こんにちは、中山です。 Terraformを使用していく中で、どのようなディレクトリ構造(tfファイルの配置方式)がベストなのかと考えたことはありませんか。私自身いろいろと試している最中なのですが、現時点で私が考えるベストプラクティスをご紹介します。 ディレクトリ構造 いきなりですが、以下のとおりです。 ├── Makefile ├── README.md ├── app.tf ├── bastion.tf ├── cloudfront.tf ├── db.tf ├── elasticache.tf ├── elb.tf ├── envs │ ├── dev │ │ ├── main.tf │ │ └── variables.tf │ ├── prd │ │ ├── main.tf │ │ └── variables.tf │ └──
Bulkheads in the USS South Dakota. Terraform state benefits from “bulkheads” too. Image from Wikipedia.Update, November 17, 2016: We took this blog post series, expanded it, and turned it into a book called Terraform: Up & Running! Update, July 8, 2019: We’ve updated this blog post series for Terraform 0.12 and released the 2nd edition of Terraform: Up & Running! Update, Sep 28, 2022: We’ve update
Let's discuss how you can hide secrets in Terraform. There are several methods, some more dangerous than others Terraform is a popular tool amongst DevOps folks that allows you to set up your infrastructure as code. It is powerful and fairly easy to get to grips with. One of the features that makes it really nice is you can make changes and run a check to see what physical changes your code change
SRE で Microservices を推進している @b4b4r07 です。 メルカリでは全社 (US/UK/JP) 的に Microservices に舵を切る経営指針が打ち出されており、Microservices Platform Team では Microservices として切り出すにふさわしいサービスの再編のサポートや、新規サービスの Microservices 化のサポート、およびそのスタンダードなインフラ基盤の開発などをしています。 本記事ではその中で開発した Developer Productivity の向上につながる小さなツールを、メルカリでの Terraform の活用事例に交えてご紹介します。 メルカリでの Terraform 活用 冒頭に挙げたとおり、少しずついろいろなサービスが立ち上がり始めていますが、そのインフラとして主に GCP (GKE) が使われて
はじめに この記事は、dwango advent calenderの12日目の記事です! 今年に入ってから、自分の担当しているプロダクトではDataDogを利用してシステムの監視を行なっています。 DataDogを導入したキッカケの一つとして、Terraformで監視設定を構成管理配下に置いてコード化したい!ということがありました。 同じ設定をGUIでぽちぽちするのはなかなかに辛いですし、ドキュメントを書き続けるのも辛いので、すでにAWSのインフラ環境構築で行なっていることと同じようなフローでコード化が行えるのは魅力の一つでした。 ということで、今回は簡単なサンプルコードと共に、TerraformとDataDogで始めるMonitoring as Code入門したいと思います。 事前に必要な作業 AWSアカウント、アクセスキー/シークレットキーの準備 1インスタンスぽこっと立ち上げます t
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く