1. Packages
  2. Alicloud Provider
  3. API Docs
  4. apigateway
  5. AclEntryAttachment
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.apigateway.AclEntryAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides an ACL entry attachment resource for attaching ACL entry to an API Gateway ACL.

    NOTE: Available since v1.228.0

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform_example";
    const _default = new alicloud.apigateway.AccessControlList("default", {
        accessControlListName: name,
        addressIpVersion: "ipv4",
    });
    const defaultAclEntryAttachment = new alicloud.apigateway.AclEntryAttachment("default", {
        aclId: _default.id,
        entry: "128.0.0.1/32",
        comment: "test comment",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform_example"
    default = alicloud.apigateway.AccessControlList("default",
        access_control_list_name=name,
        address_ip_version="ipv4")
    default_acl_entry_attachment = alicloud.apigateway.AclEntryAttachment("default",
        acl_id=default.id,
        entry="128.0.0.1/32",
        comment="test comment")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apigateway"
    	"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 := "terraform_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := apigateway.NewAccessControlList(ctx, "default", &apigateway.AccessControlListArgs{
    			AccessControlListName: pulumi.String(name),
    			AddressIpVersion:      pulumi.String("ipv4"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apigateway.NewAclEntryAttachment(ctx, "default", &apigateway.AclEntryAttachmentArgs{
    			AclId:   _default.ID(),
    			Entry:   pulumi.String("128.0.0.1/32"),
    			Comment: pulumi.String("test comment"),
    		})
    		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") ?? "terraform_example";
        var @default = new AliCloud.ApiGateway.AccessControlList("default", new()
        {
            AccessControlListName = name,
            AddressIpVersion = "ipv4",
        });
    
        var defaultAclEntryAttachment = new AliCloud.ApiGateway.AclEntryAttachment("default", new()
        {
            AclId = @default.Id,
            Entry = "128.0.0.1/32",
            Comment = "test comment",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apigateway.AccessControlList;
    import com.pulumi.alicloud.apigateway.AccessControlListArgs;
    import com.pulumi.alicloud.apigateway.AclEntryAttachment;
    import com.pulumi.alicloud.apigateway.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("terraform_example");
            var default_ = new AccessControlList("default", AccessControlListArgs.builder()
                .accessControlListName(name)
                .addressIpVersion("ipv4")
                .build());
    
            var defaultAclEntryAttachment = new AclEntryAttachment("defaultAclEntryAttachment", AclEntryAttachmentArgs.builder()
                .aclId(default_.id())
                .entry("128.0.0.1/32")
                .comment("test comment")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform_example
    resources:
      default:
        type: alicloud:apigateway:AccessControlList
        properties:
          accessControlListName: ${name}
          addressIpVersion: ipv4
      defaultAclEntryAttachment:
        type: alicloud:apigateway:AclEntryAttachment
        name: default
        properties:
          aclId: ${default.id}
          entry: 128.0.0.1/32
          comment: test comment
    

    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,
                           comment: 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:apigateway: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 alicloudAclEntryAttachmentResource = new AliCloud.ApiGateway.AclEntryAttachment("alicloudAclEntryAttachmentResource", new()
    {
        AclId = "string",
        Entry = "string",
        Comment = "string",
    });
    
    example, err := apigateway.NewAclEntryAttachment(ctx, "alicloudAclEntryAttachmentResource", &apigateway.AclEntryAttachmentArgs{
    	AclId:   pulumi.String("string"),
    	Entry:   pulumi.String("string"),
    	Comment: pulumi.String("string"),
    })
    
    var alicloudAclEntryAttachmentResource = new AclEntryAttachment("alicloudAclEntryAttachmentResource", AclEntryAttachmentArgs.builder()
        .aclId("string")
        .entry("string")
        .comment("string")
        .build());
    
    alicloud_acl_entry_attachment_resource = alicloud.apigateway.AclEntryAttachment("alicloudAclEntryAttachmentResource",
        acl_id="string",
        entry="string",
        comment="string")
    
    const alicloudAclEntryAttachmentResource = new alicloud.apigateway.AclEntryAttachment("alicloudAclEntryAttachmentResource", {
        aclId: "string",
        entry: "string",
        comment: "string",
    });
    
    type: alicloud:apigateway:AclEntryAttachment
    properties:
        aclId: string
        comment: 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 that the entry will be attached to.
    Entry string
    The CIDR block of the entry to attach.
    Comment string
    The comment for the entry.
    AclId string
    The ID of the ACL that the entry will be attached to.
    Entry string
    The CIDR block of the entry to attach.
    Comment string
    The comment for the entry.
    aclId String
    The ID of the ACL that the entry will be attached to.
    entry String
    The CIDR block of the entry to attach.
    comment String
    The comment for the entry.
    aclId string
    The ID of the ACL that the entry will be attached to.
    entry string
    The CIDR block of the entry to attach.
    comment string
    The comment for the entry.
    acl_id str
    The ID of the ACL that the entry will be attached to.
    entry str
    The CIDR block of the entry to attach.
    comment str
    The comment for the entry.
    aclId String
    The ID of the ACL that the entry will be attached to.
    entry String
    The CIDR block of the entry to attach.
    comment String
    The comment for 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.
    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 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,
            comment: Optional[str] = None,
            entry: 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 that the entry will be attached to.
    Comment string
    The comment for the entry.
    Entry string
    The CIDR block of the entry to attach.
    AclId string
    The ID of the ACL that the entry will be attached to.
    Comment string
    The comment for the entry.
    Entry string
    The CIDR block of the entry to attach.
    aclId String
    The ID of the ACL that the entry will be attached to.
    comment String
    The comment for the entry.
    entry String
    The CIDR block of the entry to attach.
    aclId string
    The ID of the ACL that the entry will be attached to.
    comment string
    The comment for the entry.
    entry string
    The CIDR block of the entry to attach.
    acl_id str
    The ID of the ACL that the entry will be attached to.
    comment str
    The comment for the entry.
    entry str
    The CIDR block of the entry to attach.
    aclId String
    The ID of the ACL that the entry will be attached to.
    comment String
    The comment for the entry.
    entry String
    The CIDR block of the entry to attach.

    Import

    Api Gateway Acl Entry Attachment can be imported using the id, e.g.

    $ pulumi import alicloud:apigateway/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.62.1 published on Monday, Sep 16, 2024 by Pulumi