Last active
August 27, 2021 06:50
-
-
Save Packet-Lost/9a698924573e88be3d79a59b1e83b401 to your computer and use it in GitHub Desktop.
ECS / Fargate Container Override with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$envkeypair = New-Object Amazon.ECS.Model.KeyValuePair | |
$envkeypair.Name = "ENVIRONMENT_KEY" | |
$envkeypair.Value = "ENVIRONMENT_VALUE" | |
$containeroverride = New-Object Amazon.ECS.Model.ContainerOverride | |
$containeroverride.Name = "CONTAINER_NAME" | |
$containeroverride.Environment.Add($envkeypair) | |
New-ECSTask -Cluster "ECS_Cluster" -Overrides_ContainerOverride $containeroverride -Count 1 -LaunchType "FARGATE" -AwsvpcConfiguration_SecurityGroup "sg-123456ab" -AwsvpcConfiguration_Subnet "subnet-123456ab","subnet-123456cd" -TaskDefinition "task_definition_name" -StartedBy "PowerShell" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment