elasticloadbalancing:SetSecurityGroups

Write

elasticloadbalancing:SetSecurityGroups is a Write access-level action in the elasticloadbalancing service. Grants permission to associate the specified security groups with the specified load balancer

Resource types

ARNs that elasticloadbalancing:SetSecurityGroups can be scoped to in an IAM policy.

arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}
loadbalancer/app/
arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/net/${LoadBalancerName}/${LoadBalancerId}
loadbalancer/net/

Condition keys

Keys you can use in the Condition block of a policy that grants elasticloadbalancing:SetSecurityGroups.

aws:ResourceTag/${TagKey} String

Filters access by a tag key and value pair of a resource

elasticloadbalancing:ResourceTag/${TagKey} String

Filters access by the preface string for a tag key and value pair that are attached to a resource

Example IAM policy

A minimal policy that allows elasticloadbalancing:SetSecurityGroups. Replace "Resource": "*" with a specific ARN to follow least privilege.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowElasticloadbalancingSetSecurityGroups",
      "Effect": "Allow",
      "Action": "elasticloadbalancing:SetSecurityGroups",
      "Resource": "*"
    }
  ]
}

Related actions in elasticloadbalancing

View all elasticloadbalancing actions →