aws logo
AWS Classic v5.41.0, May 15 23

aws.ec2clientvpn.AuthorizationRule

Explore with Pulumi AI

Provides authorization rules for AWS Client VPN endpoints. For more information on usage, please see the AWS Client VPN Administrator’s Guide.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Ec2ClientVpn.AuthorizationRule("example", new()
    {
        ClientVpnEndpointId = aws_ec2_client_vpn_endpoint.Example.Id,
        TargetNetworkCidr = aws_subnet.Example.Cidr_block,
        AuthorizeAllGroups = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2clientvpn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2clientvpn.NewAuthorizationRule(ctx, "example", &ec2clientvpn.AuthorizationRuleArgs{
			ClientVpnEndpointId: pulumi.Any(aws_ec2_client_vpn_endpoint.Example.Id),
			TargetNetworkCidr:   pulumi.Any(aws_subnet.Example.Cidr_block),
			AuthorizeAllGroups:  pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2clientvpn.AuthorizationRule;
import com.pulumi.aws.ec2clientvpn.AuthorizationRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new AuthorizationRule("example", AuthorizationRuleArgs.builder()        
            .clientVpnEndpointId(aws_ec2_client_vpn_endpoint.example().id())
            .targetNetworkCidr(aws_subnet.example().cidr_block())
            .authorizeAllGroups(true)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.ec2clientvpn.AuthorizationRule("example",
    client_vpn_endpoint_id=aws_ec2_client_vpn_endpoint["example"]["id"],
    target_network_cidr=aws_subnet["example"]["cidr_block"],
    authorize_all_groups=True)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ec2clientvpn.AuthorizationRule("example", {
    clientVpnEndpointId: aws_ec2_client_vpn_endpoint.example.id,
    targetNetworkCidr: aws_subnet.example.cidr_block,
    authorizeAllGroups: true,
});
resources:
  example:
    type: aws:ec2clientvpn:AuthorizationRule
    properties:
      clientVpnEndpointId: ${aws_ec2_client_vpn_endpoint.example.id}
      targetNetworkCidr: ${aws_subnet.example.cidr_block}
      authorizeAllGroups: true

Create AuthorizationRule Resource

new AuthorizationRule(name: string, args: AuthorizationRuleArgs, opts?: CustomResourceOptions);
@overload
def AuthorizationRule(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      access_group_id: Optional[str] = None,
                      authorize_all_groups: Optional[bool] = None,
                      client_vpn_endpoint_id: Optional[str] = None,
                      description: Optional[str] = None,
                      target_network_cidr: Optional[str] = None)
@overload
def AuthorizationRule(resource_name: str,
                      args: AuthorizationRuleArgs,
                      opts: Optional[ResourceOptions] = None)
func NewAuthorizationRule(ctx *Context, name string, args AuthorizationRuleArgs, opts ...ResourceOption) (*AuthorizationRule, error)
public AuthorizationRule(string name, AuthorizationRuleArgs args, CustomResourceOptions? opts = null)
public AuthorizationRule(String name, AuthorizationRuleArgs args)
public AuthorizationRule(String name, AuthorizationRuleArgs args, CustomResourceOptions options)
type: aws:ec2clientvpn:AuthorizationRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AuthorizationRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AuthorizationRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AuthorizationRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AuthorizationRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AuthorizationRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AuthorizationRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AuthorizationRule resource accepts the following input properties:

ClientVpnEndpointId string

The ID of the Client VPN endpoint.

TargetNetworkCidr string

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

AccessGroupId string

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

AuthorizeAllGroups bool

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

Description string

A brief description of the authorization rule.

ClientVpnEndpointId string

The ID of the Client VPN endpoint.

TargetNetworkCidr string

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

AccessGroupId string

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

AuthorizeAllGroups bool

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

Description string

A brief description of the authorization rule.

clientVpnEndpointId String

The ID of the Client VPN endpoint.

targetNetworkCidr String

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

accessGroupId String

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorizeAllGroups Boolean

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

description String

A brief description of the authorization rule.

clientVpnEndpointId string

The ID of the Client VPN endpoint.

targetNetworkCidr string

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

accessGroupId string

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorizeAllGroups boolean

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

description string

A brief description of the authorization rule.

client_vpn_endpoint_id str

The ID of the Client VPN endpoint.

target_network_cidr str

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

access_group_id str

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorize_all_groups bool

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

description str

A brief description of the authorization rule.

clientVpnEndpointId String

The ID of the Client VPN endpoint.

targetNetworkCidr String

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

accessGroupId String

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorizeAllGroups Boolean

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

description String

A brief description of the authorization rule.

Outputs

All input properties are implicitly available as output properties. Additionally, the AuthorizationRule resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing AuthorizationRule Resource

Get an existing AuthorizationRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AuthorizationRuleState, opts?: CustomResourceOptions): AuthorizationRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_group_id: Optional[str] = None,
        authorize_all_groups: Optional[bool] = None,
        client_vpn_endpoint_id: Optional[str] = None,
        description: Optional[str] = None,
        target_network_cidr: Optional[str] = None) -> AuthorizationRule
func GetAuthorizationRule(ctx *Context, name string, id IDInput, state *AuthorizationRuleState, opts ...ResourceOption) (*AuthorizationRule, error)
public static AuthorizationRule Get(string name, Input<string> id, AuthorizationRuleState? state, CustomResourceOptions? opts = null)
public static AuthorizationRule get(String name, Output<String> id, AuthorizationRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccessGroupId string

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

AuthorizeAllGroups bool

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

ClientVpnEndpointId string

The ID of the Client VPN endpoint.

Description string

A brief description of the authorization rule.

TargetNetworkCidr string

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

AccessGroupId string

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

AuthorizeAllGroups bool

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

ClientVpnEndpointId string

The ID of the Client VPN endpoint.

Description string

A brief description of the authorization rule.

TargetNetworkCidr string

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

accessGroupId String

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorizeAllGroups Boolean

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

clientVpnEndpointId String

The ID of the Client VPN endpoint.

description String

A brief description of the authorization rule.

targetNetworkCidr String

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

accessGroupId string

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorizeAllGroups boolean

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

clientVpnEndpointId string

The ID of the Client VPN endpoint.

description string

A brief description of the authorization rule.

targetNetworkCidr string

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

access_group_id str

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorize_all_groups bool

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

client_vpn_endpoint_id str

The ID of the Client VPN endpoint.

description str

A brief description of the authorization rule.

target_network_cidr str

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

accessGroupId String

The ID of the group to which the authorization rule grants access. One of access_group_id or authorize_all_groups must be set.

authorizeAllGroups Boolean

Indicates whether the authorization rule grants access to all clients. One of access_group_id or authorize_all_groups must be set.

clientVpnEndpointId String

The ID of the Client VPN endpoint.

description String

A brief description of the authorization rule.

targetNetworkCidr String

The IPv4 address range, in CIDR notation, of the network to which the authorization rule applies.

Import

AWS Client VPN authorization rules can be imported using the endpoint ID and target network CIDR. If there is a specific group name that is included as well. All values are separated by a ,.

 $ pulumi import aws:ec2clientvpn/authorizationRule:AuthorizationRule example cvpn-endpoint-0ac3a1abbccddd666,10.1.0.0/24
 $ pulumi import aws:ec2clientvpn/authorizationRule:AuthorizationRule example cvpn-endpoint-0ac3a1abbccddd666,10.1.0.0/24,team-a

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.