将 ReplaceNetworkAclAssociation 与 CLI 配合使用
以下代码示例演示如何使用 ReplaceNetworkAclAssociation。
- CLI
-
- AWS CLI
-
替换与子网关联的网络 ACL
此示例将指定的网络 ACL 与指定网络 ACL 关联的子网相关联。
命令:
aws ec2 replace-network-acl-association --association-idaclassoc-e5b95c8c--network-acl-idacl-5fb85d36输出:
{ "NewAssociationId": "aclassoc-3999875b" }-
有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 ReplaceNetworkAclAssociation
。
-
- PowerShell
-
- Tools for PowerShell V4
-
示例 1:此示例将指定的网络 ACL 与指定网络 ACL 关联的子网相关联。
Set-EC2NetworkAclAssociation -NetworkAclId acl-12345678 -AssociationId aclassoc-1a2b3c4d输出:
aclassoc-87654321-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet 参考(V4)》中的 ReplaceNetworkAclAssociation。
-
- Tools for PowerShell V5
-
示例 1:此示例将指定的网络 ACL 与指定网络 ACL 关联的子网相关联。
Set-EC2NetworkAclAssociation -NetworkAclId acl-12345678 -AssociationId aclassoc-1a2b3c4d输出:
aclassoc-87654321-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet 参考(V5)》中的 ReplaceNetworkAclAssociation。
-
有关 AWS SDK 开发人员指南和代码示例的完整列表,请参阅 使用 AWS SDK 创建 Amazon EC2 资源。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。
ReplaceIamInstanceProfileAssociation
ReplaceNetworkAclEntry