Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ECS / Fargate Container Override with PowerShell
$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