<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Illia Hryhoryshyn</title>
    <description>The latest articles on DEV Community by Illia Hryhoryshyn (@rhyhro).</description>
    <link>https://dev.to/rhyhro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F192203%2F49ee912b-76e7-4366-9a8f-9394dad68fcd.jpeg</url>
      <title>DEV Community: Illia Hryhoryshyn</title>
      <link>https://dev.to/rhyhro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rhyhro"/>
    <language>en</language>
    <item>
      <title>How to change env variables inside of docker container in AWS ECS</title>
      <dc:creator>Illia Hryhoryshyn</dc:creator>
      <pubDate>Thu, 13 May 2021 13:11:13 +0000</pubDate>
      <link>https://dev.to/rhyhro/how-to-change-env-variables-inside-of-docker-container-in-aws-ecs-13h3</link>
      <guid>https://dev.to/rhyhro/how-to-change-env-variables-inside-of-docker-container-in-aws-ecs-13h3</guid>
      <description>&lt;p&gt;For example we have cluster in AWS ECS with 3 services:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvpjmmguwfynme11ger5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvpjmmguwfynme11ger5k.png" alt="alt text"&gt;&lt;/a&gt;&lt;br&gt;
And we want to change evn variables in &lt;code&gt;api-staging&lt;/code&gt; service.&lt;/p&gt;

&lt;p&gt;To do it we should create a new revision of task definition with updated env variables and then tell the service to use new task definition.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7afk2ll9k9q44ygbwahc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7afk2ll9k9q44ygbwahc.png" alt="alt text"&gt;&lt;/a&gt;&lt;br&gt;
So, to create a new revision of task definition we should go to list of all revisions, select the last one and create a new revision.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftd3yyaynb7xu4wswwen3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftd3yyaynb7xu4wswwen3.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To change the container evn variables we should go to container definitions section and edit our container: &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F641drh99qbbn9al9ummd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F641drh99qbbn9al9ummd.png" alt="alt text"&gt;&lt;/a&gt;&lt;br&gt;
Set new values to env variables and then update container and save new revision of Task Definition:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucdhzifzcmf89unismzl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucdhzifzcmf89unismzl.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we have a new revision we should update our &lt;code&gt;api-staging&lt;/code&gt; service and set the latest revision. Also don't forget to set force new deployment checkbox &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jn5amothgc5rn98z2hn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jn5amothgc5rn98z2hn.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
