AWS 文档 SDK 示例
将 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 Reference (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 Reference (V5)》中的 ReplaceNetworkAclAssociation。
-
ReplaceIamInstanceProfileAssociation
ReplaceNetworkAclEntry