Help us understand the problem. What is going on with this article?

.ebextensions で環境変数を扱う方法

Elastic Beanstalkで.ebextensionsの中で、デプロイ環境毎に切り替えたいプロパティや、コード中にいれたくないプロパティを設定したいことは多いと思います。
その場合は、下記のように、関数 Fn:GetOptionSetting を使用して、環境プロパティを参照することができます。

.ebextensions/00.option.config
option_settings:
  aws:elasticbeanstalk:environment:
    LoadBalancerType: application

  aws:elbv2:loadbalancer:
    IdleTimeout: 300

  aws:elbv2:listener:443:
    DefaultProcess: default
    ListenerEnabled: 'true'
    Protocol: HTTPS
    SSLCertificateArns:
      "Fn::GetOptionSetting":
        Namespace: "aws:elasticbeanstalk:application:environment"
        OptionName: "ACM_CERT_ARN"
        DefaultValue: ""

あとはeb環境作成時に、環境プロパティを設定すればOKです。

$ eb create --envvars "ACM_CERT_ARN=${cert_arn}" newenv

Fn:GetOptionSetting ではネームスペースや、オプション名の選択で、他の各種設定も取得できます。

https://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/command-options.html

sabmeua
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした