1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. alb
  5. AclEntryAttachment
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.alb.AclEntryAttachment

Explore with Pulumi AI

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,
});
Copy
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)
Copy
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, &resourcemanager.GetResourceGroupsArgs{}, 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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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: {}
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. AclEntryAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. AclEntryAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AclEntryAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := alb.NewAclEntryAttachment(ctx, "aclEntryAttachmentResource", &alb.AclEntryAttachmentArgs{
	AclId:       pulumi.String("string"),
	Entry:       pulumi.String("string"),
	Description: pulumi.String("string"),
})
Copy
var aclEntryAttachmentResource = new AclEntryAttachment("aclEntryAttachmentResource", AclEntryAttachmentArgs.builder()
    .aclId("string")
    .entry("string")
    .description("string")
    .build());
Copy
acl_entry_attachment_resource = alicloud.alb.AclEntryAttachment("aclEntryAttachmentResource",
    acl_id="string",
    entry="string",
    description="string")
Copy
const aclEntryAttachmentResource = new alicloud.alb.AclEntryAttachment("aclEntryAttachmentResource", {
    aclId: "string",
    entry: "string",
    description: "string",
});
Copy
type: alicloud:alb:AclEntryAttachment
properties:
    aclId: string
    description: string
    entry: string
Copy

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

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

The AclEntryAttachment resource accepts the following input properties:

AclId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Acl.
Entry
This property is required.
Changes to this property will trigger replacement.
string
The CIDR blocks.
Description Changes to this property will trigger replacement. string
The description of the entry.
AclId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Acl.
Entry
This property is required.
Changes to this property will trigger replacement.
string
The CIDR blocks.
Description Changes to this property will trigger replacement. string
The description of the entry.
aclId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Acl.
entry
This property is required.
Changes to this property will trigger replacement.
String
The CIDR blocks.
description Changes to this property will trigger replacement. String
The description of the entry.
aclId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Acl.
entry
This property is required.
Changes to this property will trigger replacement.
string
The CIDR blocks.
description Changes to this property will trigger replacement. string
The description of the entry.
acl_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Acl.
entry
This property is required.
Changes to this property will trigger replacement.
str
The CIDR blocks.
description Changes to this property will trigger replacement. str
The description of the entry.
aclId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Acl.
entry
This property is required.
Changes to this property will trigger replacement.
String
The CIDR blocks.
description Changes to this property will trigger replacement. 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)
resources:  _:    type: alicloud:alb:AclEntryAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
The ID of the Acl.
Description Changes to this property will trigger replacement. string
The description of the entry.
Entry Changes to this property will trigger replacement. string
The CIDR blocks.
Status string
The Status of the resource.
AclId Changes to this property will trigger replacement. string
The ID of the Acl.
Description Changes to this property will trigger replacement. string
The description of the entry.
Entry Changes to this property will trigger replacement. string
The CIDR blocks.
Status string
The Status of the resource.
aclId Changes to this property will trigger replacement. String
The ID of the Acl.
description Changes to this property will trigger replacement. String
The description of the entry.
entry Changes to this property will trigger replacement. String
The CIDR blocks.
status String
The Status of the resource.
aclId Changes to this property will trigger replacement. string
The ID of the Acl.
description Changes to this property will trigger replacement. string
The description of the entry.
entry Changes to this property will trigger replacement. string
The CIDR blocks.
status string
The Status of the resource.
acl_id Changes to this property will trigger replacement. str
The ID of the Acl.
description Changes to this property will trigger replacement. str
The description of the entry.
entry Changes to this property will trigger replacement. str
The CIDR blocks.
status str
The Status of the resource.
aclId Changes to this property will trigger replacement. String
The ID of the Acl.
description Changes to this property will trigger replacement. String
The description of the entry.
entry Changes to this property will trigger replacement. 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>
Copy

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.