Skip to content

Commit

Permalink
feat(client-ec2): This release adds two new capabilities to VPC Secur…
Browse files Browse the repository at this point in the history
…ity Groups: Security Group VPC Associations and Shared Security Groups.
  • Loading branch information
awstools committed Oct 30, 2024
1 parent 9029bbd commit 095a3b8
Show file tree
Hide file tree
Showing 48 changed files with 3,007 additions and 1,373 deletions.
24 changes: 24 additions & 0 deletions clients/client-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,14 @@ AssociateRouteTable

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/AssociateRouteTableCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/AssociateRouteTableCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/AssociateRouteTableCommandOutput/)

</details>
<details>
<summary>
AssociateSecurityGroupVpc
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/AssociateSecurityGroupVpcCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/AssociateSecurityGroupVpcCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/AssociateSecurityGroupVpcCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -2829,6 +2837,14 @@ DescribeSecurityGroups

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/DescribeSecurityGroupsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DescribeSecurityGroupsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DescribeSecurityGroupsCommandOutput/)

</details>
<details>
<summary>
DescribeSecurityGroupVpcAssociations
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/DescribeSecurityGroupVpcAssociationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DescribeSecurityGroupVpcAssociationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DescribeSecurityGroupVpcAssociationsCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -3485,6 +3501,14 @@ DisassociateRouteTable

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/DisassociateRouteTableCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DisassociateRouteTableCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DisassociateRouteTableCommandOutput/)

</details>
<details>
<summary>
DisassociateSecurityGroupVpc
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/DisassociateSecurityGroupVpcCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DisassociateSecurityGroupVpcCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Interface/DisassociateSecurityGroupVpcCommandOutput/)

</details>
<details>
<summary>
Expand Down
70 changes: 70 additions & 0 deletions clients/client-ec2/src/EC2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ import {
AssociateRouteTableCommandInput,
AssociateRouteTableCommandOutput,
} from "./commands/AssociateRouteTableCommand";
import {
AssociateSecurityGroupVpcCommand,
AssociateSecurityGroupVpcCommandInput,
AssociateSecurityGroupVpcCommandOutput,
} from "./commands/AssociateSecurityGroupVpcCommand";
import {
AssociateSubnetCidrBlockCommand,
AssociateSubnetCidrBlockCommandInput,
Expand Down Expand Up @@ -1598,6 +1603,11 @@ import {
DescribeSecurityGroupsCommandInput,
DescribeSecurityGroupsCommandOutput,
} from "./commands/DescribeSecurityGroupsCommand";
import {
DescribeSecurityGroupVpcAssociationsCommand,
DescribeSecurityGroupVpcAssociationsCommandInput,
DescribeSecurityGroupVpcAssociationsCommandOutput,
} from "./commands/DescribeSecurityGroupVpcAssociationsCommand";
import {
DescribeSnapshotAttributeCommand,
DescribeSnapshotAttributeCommandInput,
Expand Down Expand Up @@ -2008,6 +2018,11 @@ import {
DisassociateRouteTableCommandInput,
DisassociateRouteTableCommandOutput,
} from "./commands/DisassociateRouteTableCommand";
import {
DisassociateSecurityGroupVpcCommand,
DisassociateSecurityGroupVpcCommandInput,
DisassociateSecurityGroupVpcCommandOutput,
} from "./commands/DisassociateSecurityGroupVpcCommand";
import {
DisassociateSubnetCidrBlockCommand,
DisassociateSubnetCidrBlockCommandInput,
Expand Down Expand Up @@ -3134,6 +3149,7 @@ const commands = {
AssociateIpamResourceDiscoveryCommand,
AssociateNatGatewayAddressCommand,
AssociateRouteTableCommand,
AssociateSecurityGroupVpcCommand,
AssociateSubnetCidrBlockCommand,
AssociateTransitGatewayMulticastDomainCommand,
AssociateTransitGatewayPolicyTableCommand,
Expand Down Expand Up @@ -3435,6 +3451,7 @@ const commands = {
DescribeSecurityGroupReferencesCommand,
DescribeSecurityGroupRulesCommand,
DescribeSecurityGroupsCommand,
DescribeSecurityGroupVpcAssociationsCommand,
DescribeSnapshotAttributeCommand,
DescribeSnapshotsCommand,
DescribeSnapshotTierStatusCommand,
Expand Down Expand Up @@ -3517,6 +3534,7 @@ const commands = {
DisassociateIpamResourceDiscoveryCommand,
DisassociateNatGatewayAddressCommand,
DisassociateRouteTableCommand,
DisassociateSecurityGroupVpcCommand,
DisassociateSubnetCidrBlockCommand,
DisassociateTransitGatewayMulticastDomainCommand,
DisassociateTransitGatewayPolicyTableCommand,
Expand Down Expand Up @@ -4197,6 +4215,23 @@ export interface EC2 {
cb: (err: any, data?: AssociateRouteTableCommandOutput) => void
): void;

/**
* @see {@link AssociateSecurityGroupVpcCommand}
*/
associateSecurityGroupVpc(
args: AssociateSecurityGroupVpcCommandInput,
options?: __HttpHandlerOptions
): Promise<AssociateSecurityGroupVpcCommandOutput>;
associateSecurityGroupVpc(
args: AssociateSecurityGroupVpcCommandInput,
cb: (err: any, data?: AssociateSecurityGroupVpcCommandOutput) => void
): void;
associateSecurityGroupVpc(
args: AssociateSecurityGroupVpcCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: AssociateSecurityGroupVpcCommandOutput) => void
): void;

/**
* @see {@link AssociateSubnetCidrBlockCommand}
*/
Expand Down Expand Up @@ -9225,6 +9260,24 @@ export interface EC2 {
cb: (err: any, data?: DescribeSecurityGroupsCommandOutput) => void
): void;

/**
* @see {@link DescribeSecurityGroupVpcAssociationsCommand}
*/
describeSecurityGroupVpcAssociations(): Promise<DescribeSecurityGroupVpcAssociationsCommandOutput>;
describeSecurityGroupVpcAssociations(
args: DescribeSecurityGroupVpcAssociationsCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeSecurityGroupVpcAssociationsCommandOutput>;
describeSecurityGroupVpcAssociations(
args: DescribeSecurityGroupVpcAssociationsCommandInput,
cb: (err: any, data?: DescribeSecurityGroupVpcAssociationsCommandOutput) => void
): void;
describeSecurityGroupVpcAssociations(
args: DescribeSecurityGroupVpcAssociationsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeSecurityGroupVpcAssociationsCommandOutput) => void
): void;

/**
* @see {@link DescribeSnapshotAttributeCommand}
*/
Expand Down Expand Up @@ -10639,6 +10692,23 @@ export interface EC2 {
cb: (err: any, data?: DisassociateRouteTableCommandOutput) => void
): void;

/**
* @see {@link DisassociateSecurityGroupVpcCommand}
*/
disassociateSecurityGroupVpc(
args: DisassociateSecurityGroupVpcCommandInput,
options?: __HttpHandlerOptions
): Promise<DisassociateSecurityGroupVpcCommandOutput>;
disassociateSecurityGroupVpc(
args: DisassociateSecurityGroupVpcCommandInput,
cb: (err: any, data?: DisassociateSecurityGroupVpcCommandOutput) => void
): void;
disassociateSecurityGroupVpc(
args: DisassociateSecurityGroupVpcCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DisassociateSecurityGroupVpcCommandOutput) => void
): void;

/**
* @see {@link DisassociateSubnetCidrBlockCommand}
*/
Expand Down
18 changes: 18 additions & 0 deletions clients/client-ec2/src/EC2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ import {
AssociateRouteTableCommandInput,
AssociateRouteTableCommandOutput,
} from "./commands/AssociateRouteTableCommand";
import {
AssociateSecurityGroupVpcCommandInput,
AssociateSecurityGroupVpcCommandOutput,
} from "./commands/AssociateSecurityGroupVpcCommand";
import {
AssociateSubnetCidrBlockCommandInput,
AssociateSubnetCidrBlockCommandOutput,
Expand Down Expand Up @@ -1134,6 +1138,10 @@ import {
DescribeSecurityGroupsCommandInput,
DescribeSecurityGroupsCommandOutput,
} from "./commands/DescribeSecurityGroupsCommand";
import {
DescribeSecurityGroupVpcAssociationsCommandInput,
DescribeSecurityGroupVpcAssociationsCommandOutput,
} from "./commands/DescribeSecurityGroupVpcAssociationsCommand";
import {
DescribeSnapshotAttributeCommandInput,
DescribeSnapshotAttributeCommandOutput,
Expand Down Expand Up @@ -1435,6 +1443,10 @@ import {
DisassociateRouteTableCommandInput,
DisassociateRouteTableCommandOutput,
} from "./commands/DisassociateRouteTableCommand";
import {
DisassociateSecurityGroupVpcCommandInput,
DisassociateSecurityGroupVpcCommandOutput,
} from "./commands/DisassociateSecurityGroupVpcCommand";
import {
DisassociateSubnetCidrBlockCommandInput,
DisassociateSubnetCidrBlockCommandOutput,
Expand Down Expand Up @@ -2247,6 +2259,7 @@ export type ServiceInputTypes =
| AssociateIpamResourceDiscoveryCommandInput
| AssociateNatGatewayAddressCommandInput
| AssociateRouteTableCommandInput
| AssociateSecurityGroupVpcCommandInput
| AssociateSubnetCidrBlockCommandInput
| AssociateTransitGatewayMulticastDomainCommandInput
| AssociateTransitGatewayPolicyTableCommandInput
Expand Down Expand Up @@ -2547,6 +2560,7 @@ export type ServiceInputTypes =
| DescribeScheduledInstancesCommandInput
| DescribeSecurityGroupReferencesCommandInput
| DescribeSecurityGroupRulesCommandInput
| DescribeSecurityGroupVpcAssociationsCommandInput
| DescribeSecurityGroupsCommandInput
| DescribeSnapshotAttributeCommandInput
| DescribeSnapshotTierStatusCommandInput
Expand Down Expand Up @@ -2630,6 +2644,7 @@ export type ServiceInputTypes =
| DisassociateIpamResourceDiscoveryCommandInput
| DisassociateNatGatewayAddressCommandInput
| DisassociateRouteTableCommandInput
| DisassociateSecurityGroupVpcCommandInput
| DisassociateSubnetCidrBlockCommandInput
| DisassociateTransitGatewayMulticastDomainCommandInput
| DisassociateTransitGatewayPolicyTableCommandInput
Expand Down Expand Up @@ -2886,6 +2901,7 @@ export type ServiceOutputTypes =
| AssociateIpamResourceDiscoveryCommandOutput
| AssociateNatGatewayAddressCommandOutput
| AssociateRouteTableCommandOutput
| AssociateSecurityGroupVpcCommandOutput
| AssociateSubnetCidrBlockCommandOutput
| AssociateTransitGatewayMulticastDomainCommandOutput
| AssociateTransitGatewayPolicyTableCommandOutput
Expand Down Expand Up @@ -3186,6 +3202,7 @@ export type ServiceOutputTypes =
| DescribeScheduledInstancesCommandOutput
| DescribeSecurityGroupReferencesCommandOutput
| DescribeSecurityGroupRulesCommandOutput
| DescribeSecurityGroupVpcAssociationsCommandOutput
| DescribeSecurityGroupsCommandOutput
| DescribeSnapshotAttributeCommandOutput
| DescribeSnapshotTierStatusCommandOutput
Expand Down Expand Up @@ -3269,6 +3286,7 @@ export type ServiceOutputTypes =
| DisassociateIpamResourceDiscoveryCommandOutput
| DisassociateNatGatewayAddressCommandOutput
| DisassociateRouteTableCommandOutput
| DisassociateSecurityGroupVpcCommandOutput
| DisassociateSubnetCidrBlockCommandOutput
| DisassociateTransitGatewayMulticastDomainCommandOutput
| DisassociateTransitGatewayPolicyTableCommandOutput
Expand Down
113 changes: 113 additions & 0 deletions clients/client-ec2/src/commands/AssociateSecurityGroupVpcCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client";
import { commonParams } from "../endpoint/EndpointParameters";
import { AssociateSecurityGroupVpcRequest, AssociateSecurityGroupVpcResult } from "../models/models_0";
import { de_AssociateSecurityGroupVpcCommand, se_AssociateSecurityGroupVpcCommand } from "../protocols/Aws_ec2";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link AssociateSecurityGroupVpcCommand}.
*/
export interface AssociateSecurityGroupVpcCommandInput extends AssociateSecurityGroupVpcRequest {}
/**
* @public
*
* The output of {@link AssociateSecurityGroupVpcCommand}.
*/
export interface AssociateSecurityGroupVpcCommandOutput extends AssociateSecurityGroupVpcResult, __MetadataBearer {}

/**
* <p>Associates a security group with another VPC in the same Region. This enables you to use the same security group with network interfaces and instances in the specified VPC.</p>
* <note>
* <ul>
* <li>
* <p>The VPC you want to associate the security group with must be in the same Region.</p>
* </li>
* <li>
* <p>You can associate the security group with another VPC if your account owns the VPC or if the VPC was shared with you.</p>
* </li>
* <li>
* <p>You must own the security group and the VPC that it was created in.</p>
* </li>
* <li>
* <p>You cannot use this feature with default security groups.</p>
* </li>
* <li>
* <p>You cannot use this feature with the default VPC.</p>
* </li>
* </ul>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { EC2Client, AssociateSecurityGroupVpcCommand } from "@aws-sdk/client-ec2"; // ES Modules import
* // const { EC2Client, AssociateSecurityGroupVpcCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
* const client = new EC2Client(config);
* const input = { // AssociateSecurityGroupVpcRequest
* GroupId: "STRING_VALUE", // required
* VpcId: "STRING_VALUE", // required
* DryRun: true || false,
* };
* const command = new AssociateSecurityGroupVpcCommand(input);
* const response = await client.send(command);
* // { // AssociateSecurityGroupVpcResult
* // State: "associating" || "associated" || "association-failed" || "disassociating" || "disassociated" || "disassociation-failed",
* // };
*
* ```
*
* @param AssociateSecurityGroupVpcCommandInput - {@link AssociateSecurityGroupVpcCommandInput}
* @returns {@link AssociateSecurityGroupVpcCommandOutput}
* @see {@link AssociateSecurityGroupVpcCommandInput} for command's `input` shape.
* @see {@link AssociateSecurityGroupVpcCommandOutput} for command's `response` shape.
* @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape.
*
* @throws {@link EC2ServiceException}
* <p>Base exception class for all service exceptions from EC2 service.</p>
*
* @public
*/
export class AssociateSecurityGroupVpcCommand extends $Command
.classBuilder<
AssociateSecurityGroupVpcCommandInput,
AssociateSecurityGroupVpcCommandOutput,
EC2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonEC2", "AssociateSecurityGroupVpc", {})
.n("EC2Client", "AssociateSecurityGroupVpcCommand")
.f(void 0, void 0)
.ser(se_AssociateSecurityGroupVpcCommand)
.de(de_AssociateSecurityGroupVpcCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: AssociateSecurityGroupVpcRequest;
output: AssociateSecurityGroupVpcResult;
};
sdk: {
input: AssociateSecurityGroupVpcCommandInput;
output: AssociateSecurityGroupVpcCommandOutput;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export interface AuthorizeSecurityGroupEgressCommandOutput
* // Value: "STRING_VALUE",
* // },
* // ],
* // SecurityGroupRuleArn: "STRING_VALUE",
* // },
* // ],
* // };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export interface AuthorizeSecurityGroupIngressCommandOutput
* // Value: "STRING_VALUE",
* // },
* // ],
* // SecurityGroupRuleArn: "STRING_VALUE",
* // },
* // ],
* // };
Expand Down
Loading

0 comments on commit 095a3b8

Please sign in to comment.