1. Packages
  2. AWS
  3. API Docs
  4. ec2clientvpn
  5. AuthorizationRule
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.ec2clientvpn.AuthorizationRule

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2clientvpn.AuthorizationRule("example", {
        clientVpnEndpointId: exampleAwsEc2ClientVpnEndpoint.id,
        targetNetworkCidr: exampleAwsSubnet.cidrBlock,
        authorizeAllGroups: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2clientvpn.AuthorizationRule("example",
        client_vpn_endpoint_id=example_aws_ec2_client_vpn_endpoint["id"],
        target_network_cidr=example_aws_subnet["cidrBlock"],
        authorize_all_groups=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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(exampleAwsEc2ClientVpnEndpoint.Id),
    			TargetNetworkCidr:   pulumi.Any(exampleAwsSubnet.CidrBlock),
    			AuthorizeAllGroups:  pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = exampleAwsEc2ClientVpnEndpoint.Id,
            TargetNetworkCidr = exampleAwsSubnet.CidrBlock,
            AuthorizeAllGroups = true,
        });
    
    });
    
    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(exampleAwsEc2ClientVpnEndpoint.id())
                .targetNetworkCidr(exampleAwsSubnet.cidrBlock())
                .authorizeAllGroups(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2clientvpn:AuthorizationRule
        properties:
          clientVpnEndpointId: ${exampleAwsEc2ClientVpnEndpoint.id}
          targetNetworkCidr: ${exampleAwsSubnet.cidrBlock}
          authorizeAllGroups: true
    

    Create AuthorizationRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AuthorizationRule(name: string, args: AuthorizationRuleArgs, opts?: CustomResourceOptions);
    @overload
    def AuthorizationRule(resource_name: str,
                          args: AuthorizationRuleArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def AuthorizationRule(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          client_vpn_endpoint_id: Optional[str] = None,
                          target_network_cidr: Optional[str] = None,
                          access_group_id: Optional[str] = None,
                          authorize_all_groups: Optional[bool] = None,
                          description: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var authorizationRuleResource = new Aws.Ec2ClientVpn.AuthorizationRule("authorizationRuleResource", new()
    {
        ClientVpnEndpointId = "string",
        TargetNetworkCidr = "string",
        AccessGroupId = "string",
        AuthorizeAllGroups = false,
        Description = "string",
    });
    
    example, err := ec2clientvpn.NewAuthorizationRule(ctx, "authorizationRuleResource", &ec2clientvpn.AuthorizationRuleArgs{
    	ClientVpnEndpointId: pulumi.String("string"),
    	TargetNetworkCidr:   pulumi.String("string"),
    	AccessGroupId:       pulumi.String("string"),
    	AuthorizeAllGroups:  pulumi.Bool(false),
    	Description:         pulumi.String("string"),
    })
    
    var authorizationRuleResource = new AuthorizationRule("authorizationRuleResource", AuthorizationRuleArgs.builder()
        .clientVpnEndpointId("string")
        .targetNetworkCidr("string")
        .accessGroupId("string")
        .authorizeAllGroups(false)
        .description("string")
        .build());
    
    authorization_rule_resource = aws.ec2clientvpn.AuthorizationRule("authorizationRuleResource",
        client_vpn_endpoint_id="string",
        target_network_cidr="string",
        access_group_id="string",
        authorize_all_groups=False,
        description="string")
    
    const authorizationRuleResource = new aws.ec2clientvpn.AuthorizationRule("authorizationRuleResource", {
        clientVpnEndpointId: "string",
        targetNetworkCidr: "string",
        accessGroupId: "string",
        authorizeAllGroups: false,
        description: "string",
    });
    
    type: aws:ec2clientvpn:AuthorizationRule
    properties:
        accessGroupId: string
        authorizeAllGroups: false
        clientVpnEndpointId: string
        description: string
        targetNetworkCidr: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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

    Using the endpoint ID, target network CIDR, and group name:

    Using pulumi import to import AWS Client VPN authorization rules using the endpoint ID and target network CIDR. If there is a specific group name, include that also. All values are separated by a ,. For example:

    Using the endpoint ID and target network CIDR:

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

    Using the endpoint ID, target network CIDR, and group name:

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi