1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. alb
  5. AclEntryAttachment
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.alb.AclEntryAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    For information about acl entry attachment and how to use it, see Configure an acl entry.

    NOTE: Available since v1.166.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf_example";
    const default = alicloud.resourcemanager.getResourceGroups({});
    const defaultAcl = new alicloud.alb.Acl("default", {
        aclName: name,
        resourceGroupId: _default.then(_default => _default.groups?.[0]?.id),
    });
    const defaultAclEntryAttachment = new alicloud.alb.AclEntryAttachment("default", {
        aclId: defaultAcl.id,
        entry: "168.10.10.0/24",
        description: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_example"
    default = alicloud.resourcemanager.get_resource_groups()
    default_acl = alicloud.alb.Acl("default",
        acl_name=name,
        resource_group_id=default.groups[0].id)
    default_acl_entry_attachment = alicloud.alb.AclEntryAttachment("default",
        acl_id=default_acl.id,
        entry="168.10.10.0/24",
        description=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/alb"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := resourcemanager.GetResourceGroups(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultAcl, err := alb.NewAcl(ctx, "default", &alb.AclArgs{
    			AclName:         pulumi.String(name),
    			ResourceGroupId: pulumi.String(_default.Groups[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = alb.NewAclEntryAttachment(ctx, "default", &alb.AclEntryAttachmentArgs{
    			AclId:       defaultAcl.ID(),
    			Entry:       pulumi.String("168.10.10.0/24"),
    			Description: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf_example";
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
    
        var defaultAcl = new AliCloud.Alb.Acl("default", new()
        {
            AclName = name,
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id)),
        });
    
        var defaultAclEntryAttachment = new AliCloud.Alb.AclEntryAttachment("default", new()
        {
            AclId = defaultAcl.Id,
            Entry = "168.10.10.0/24",
            Description = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.alb.Acl;
    import com.pulumi.alicloud.alb.AclArgs;
    import com.pulumi.alicloud.alb.AclEntryAttachment;
    import com.pulumi.alicloud.alb.AclEntryAttachmentArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tf_example");
            final var default = ResourcemanagerFunctions.getResourceGroups();
    
            var defaultAcl = new Acl("defaultAcl", AclArgs.builder()
                .aclName(name)
                .resourceGroupId(default_.groups()[0].id())
                .build());
    
            var defaultAclEntryAttachment = new AclEntryAttachment("defaultAclEntryAttachment", AclEntryAttachmentArgs.builder()
                .aclId(defaultAcl.id())
                .entry("168.10.10.0/24")
                .description(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf_example
    resources:
      defaultAcl:
        type: alicloud:alb:Acl
        name: default
        properties:
          aclName: ${name}
          resourceGroupId: ${default.groups[0].id}
      defaultAclEntryAttachment:
        type: alicloud:alb:AclEntryAttachment
        name: default
        properties:
          aclId: ${defaultAcl.id}
          entry: 168.10.10.0/24
          description: ${name}
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments: {}
    

    Create AclEntryAttachment Resource

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

    Constructor syntax

    new AclEntryAttachment(name: string, args: AclEntryAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def AclEntryAttachment(resource_name: str,
                           args: AclEntryAttachmentArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def AclEntryAttachment(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           acl_id: Optional[str] = None,
                           entry: Optional[str] = None,
                           description: Optional[str] = None)
    func NewAclEntryAttachment(ctx *Context, name string, args AclEntryAttachmentArgs, opts ...ResourceOption) (*AclEntryAttachment, error)
    public AclEntryAttachment(string name, AclEntryAttachmentArgs args, CustomResourceOptions? opts = null)
    public AclEntryAttachment(String name, AclEntryAttachmentArgs args)
    public AclEntryAttachment(String name, AclEntryAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:alb:AclEntryAttachment
    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 AclEntryAttachmentArgs
    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 AclEntryAttachmentArgs
    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 AclEntryAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AclEntryAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AclEntryAttachmentArgs
    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 aclEntryAttachmentResource = new AliCloud.Alb.AclEntryAttachment("aclEntryAttachmentResource", new()
    {
        AclId = "string",
        Entry = "string",
        Description = "string",
    });
    
    example, err := alb.NewAclEntryAttachment(ctx, "aclEntryAttachmentResource", &alb.AclEntryAttachmentArgs{
    	AclId:       pulumi.String("string"),
    	Entry:       pulumi.String("string"),
    	Description: pulumi.String("string"),
    })
    
    var aclEntryAttachmentResource = new AclEntryAttachment("aclEntryAttachmentResource", AclEntryAttachmentArgs.builder()
        .aclId("string")
        .entry("string")
        .description("string")
        .build());
    
    acl_entry_attachment_resource = alicloud.alb.AclEntryAttachment("aclEntryAttachmentResource",
        acl_id="string",
        entry="string",
        description="string")
    
    const aclEntryAttachmentResource = new alicloud.alb.AclEntryAttachment("aclEntryAttachmentResource", {
        aclId: "string",
        entry: "string",
        description: "string",
    });
    
    type: alicloud:alb:AclEntryAttachment
    properties:
        aclId: string
        description: string
        entry: string
    

    AclEntryAttachment 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 AclEntryAttachment resource accepts the following input properties:

    AclId string
    The ID of the Acl.
    Entry string
    The CIDR blocks.
    Description string
    The description of the entry.
    AclId string
    The ID of the Acl.
    Entry string
    The CIDR blocks.
    Description string
    The description of the entry.
    aclId String
    The ID of the Acl.
    entry String
    The CIDR blocks.
    description String
    The description of the entry.
    aclId string
    The ID of the Acl.
    entry string
    The CIDR blocks.
    description string
    The description of the entry.
    acl_id str
    The ID of the Acl.
    entry str
    The CIDR blocks.
    description str
    The description of the entry.
    aclId String
    The ID of the Acl.
    entry String
    The CIDR blocks.
    description String
    The description of the entry.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The Status of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The Status of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The Status of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The Status of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The Status of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The Status of the resource.

    Look up Existing AclEntryAttachment Resource

    Get an existing AclEntryAttachment 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?: AclEntryAttachmentState, opts?: CustomResourceOptions): AclEntryAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            acl_id: Optional[str] = None,
            description: Optional[str] = None,
            entry: Optional[str] = None,
            status: Optional[str] = None) -> AclEntryAttachment
    func GetAclEntryAttachment(ctx *Context, name string, id IDInput, state *AclEntryAttachmentState, opts ...ResourceOption) (*AclEntryAttachment, error)
    public static AclEntryAttachment Get(string name, Input<string> id, AclEntryAttachmentState? state, CustomResourceOptions? opts = null)
    public static AclEntryAttachment get(String name, Output<String> id, AclEntryAttachmentState 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:
    AclId string
    The ID of the Acl.
    Description string
    The description of the entry.
    Entry string
    The CIDR blocks.
    Status string
    The Status of the resource.
    AclId string
    The ID of the Acl.
    Description string
    The description of the entry.
    Entry string
    The CIDR blocks.
    Status string
    The Status of the resource.
    aclId String
    The ID of the Acl.
    description String
    The description of the entry.
    entry String
    The CIDR blocks.
    status String
    The Status of the resource.
    aclId string
    The ID of the Acl.
    description string
    The description of the entry.
    entry string
    The CIDR blocks.
    status string
    The Status of the resource.
    acl_id str
    The ID of the Acl.
    description str
    The description of the entry.
    entry str
    The CIDR blocks.
    status str
    The Status of the resource.
    aclId String
    The ID of the Acl.
    description String
    The description of the entry.
    entry String
    The CIDR blocks.
    status String
    The Status of the resource.

    Import

    Acl entry attachment can be imported using the id, e.g.

    $ pulumi import alicloud:alb/aclEntryAttachment:AclEntryAttachment example <acl_id>:<entry>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi