modifyNetworkInterfaceAttribute

Modifies the specified network interface attribute. You can specify only one attribute at a time. You can use this action to attach and detach security groups from an existing EC2 instance.

Samples

// This example modifies the attachment attribute of the specified network interface.
ec2Client.modifyNetworkInterfaceAttribute {
    networkInterfaceId = "eni-686ea200"
    attachment = NetworkInterfaceAttachmentChanges {
        attachmentId = "eni-attach-43348162"
        deleteOnTermination = false
    }
}
// This example modifies the description attribute of the specified network interface.
ec2Client.modifyNetworkInterfaceAttribute {
    networkInterfaceId = "eni-686ea200"
    description = AttributeValue {
        value = "My description"
    }
}
// This example command modifies the groupSet attribute of the specified network interface.
ec2Client.modifyNetworkInterfaceAttribute {
    networkInterfaceId = "eni-686ea200"
    groups = listOf<String>(
        "sg-903004f8",
        "sg-1a2b3c4d"
    )
}
// This example command modifies the sourceDestCheck attribute of the specified network interface.
ec2Client.modifyNetworkInterfaceAttribute {
    networkInterfaceId = "eni-686ea200"
    sourceDestCheck = AttributeBooleanValue {
        value = false
    }
}