

This is the new *Amazon CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [Amazon CloudFormation User Guide](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::AmplifyGen3::NetworkConnector

The `AWS::AmplifyGen3::NetworkConnector` resource specifies a network connector that gives Amazon Amplify Gen 3 environments access to a virtual private cloud (VPC) in your account.

## Syntax
<a name="aws-resource-amplifygen3-networkconnector-syntax"></a>

To declare this entity in your Amazon CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-amplifygen3-networkconnector-syntax.json"></a>

```json
{
  "Type" : "AWS::AmplifyGen3::NetworkConnector",
  "Properties" : {
      "[NetworkConnectorName](#cfn-amplifygen3-networkconnector-networkconnectorname)" : {{String}},
      "[NetworkConnectorRoleArn](#cfn-amplifygen3-networkconnector-networkconnectorrolearn)" : {{String}},
      "[SecurityGroupIds](#cfn-amplifygen3-networkconnector-securitygroupids)" : {{[ String, ... ]}},
      "[SubnetIds](#cfn-amplifygen3-networkconnector-subnetids)" : {{[ String, ... ]}},
      "[Tags](#cfn-amplifygen3-networkconnector-tags)" : {{[ Tag, ... ]}}
    }
}
```

### YAML
<a name="aws-resource-amplifygen3-networkconnector-syntax.yaml"></a>

```yaml
Type: AWS::AmplifyGen3::NetworkConnector
Properties:
  [NetworkConnectorName](#cfn-amplifygen3-networkconnector-networkconnectorname): {{String}}
  [NetworkConnectorRoleArn](#cfn-amplifygen3-networkconnector-networkconnectorrolearn): {{String}}
  [SecurityGroupIds](#cfn-amplifygen3-networkconnector-securitygroupids): {{
    - String}}
  [SubnetIds](#cfn-amplifygen3-networkconnector-subnetids): {{
    - String}}
  [Tags](#cfn-amplifygen3-networkconnector-tags): {{
    - Tag}}
```

## Properties
<a name="aws-resource-amplifygen3-networkconnector-properties"></a>

`NetworkConnectorName`  <a name="cfn-amplifygen3-networkconnector-networkconnectorname"></a>
The name of the network connector.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$`  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [Replacement](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`NetworkConnectorRoleArn`  <a name="cfn-amplifygen3-networkconnector-networkconnectorrolearn"></a>
The Amazon Resource Name (ARN) of the IAM role for the network connector.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$`  
*Minimum*: `20`  
*Maximum*: `2048`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SecurityGroupIds`  <a name="cfn-amplifygen3-networkconnector-securitygroupids"></a>
The IDs of the security groups.  
*Required*: Yes  
*Type*: Array of String  
*Minimum*: `11 | 1`  
*Maximum*: `20 | 5`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SubnetIds`  <a name="cfn-amplifygen3-networkconnector-subnetids"></a>
The IDs of the subnets.  
*Required*: Yes  
*Type*: Array of String  
*Minimum*: `15 | 1`  
*Maximum*: `24 | 16`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-amplifygen3-networkconnector-tags"></a>
An array of key-value pairs to apply to this resource.  
For more information, see [Tag](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/aws-properties-resource-tags.html).  
*Required*: No  
*Type*: Array of [Tag](aws-properties-amplifygen3-networkconnector-tag.md)  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-amplifygen3-networkconnector-return-values"></a>

### Ref
<a name="aws-resource-amplifygen3-networkconnector-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the ARN of the network connector.

For more information about using the `Ref` function, see [`Ref`](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-amplifygen3-networkconnector-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [`Fn::GetAtt`](https://docs.amazonaws.cn/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-amplifygen3-networkconnector-return-values-fn--getatt-fn--getatt"></a>

`CreatedAt`  <a name="CreatedAt-fn::getatt"></a>
The time at which the network connector was created. The value is in ISO-8601 format.

`NetworkConnectorArn`  <a name="NetworkConnectorArn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the network connector.

## Examples
<a name="aws-resource-amplifygen3-networkconnector--examples"></a>

### Create a network connector
<a name="aws-resource-amplifygen3-networkconnector--examples--Create_a_network_connector"></a>

The following example creates a network connector for two subnets and one security group.

#### JSON
<a name="aws-resource-amplifygen3-networkconnector--examples--Create_a_network_connector--json"></a>

```json
{
    "Resources": {
        "MyNetworkConnector": {
            "Type": "AWS::AmplifyGen3::NetworkConnector",
            "Properties": {
                "NetworkConnectorName": "my-network-connector",
                "SubnetIds": [
                    "subnet-0123456789abcdef0",
                    "subnet-0fedcba9876543210"
                ],
                "SecurityGroupIds": [
                    "sg-0123456789abcdef0"
                ],
                "NetworkConnectorRoleArn": "arn:aws:iam::123456789012:role/AmplifyGen3NetworkConnectorRole"
            }
        }
    }
}
```

#### YAML
<a name="aws-resource-amplifygen3-networkconnector--examples--Create_a_network_connector--yaml"></a>

```yaml
Resources:
  MyNetworkConnector:
    Type: AWS::AmplifyGen3::NetworkConnector
    Properties:
      NetworkConnectorName: my-network-connector
      SubnetIds:
      - subnet-0123456789abcdef0
      - subnet-0fedcba9876543210
      SecurityGroupIds:
      - sg-0123456789abcdef0
      NetworkConnectorRoleArn: arn:aws:iam::123456789012:role/AmplifyGen3NetworkConnectorRole
```