Provides a Threat Detection Asset Bind resource.
Asset Binding Information.
For information about Threat Detection Asset Bind and how to use it, see What is Asset Bind.
NOTE: Available since v1.247.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 = alicloud.threatdetection.getAssets({
machineTypes: "ecs",
});
const defaultAssetBind = new alicloud.threatdetection.AssetBind("default", {
uuid: _default.then(_default => _default.assets?.[0]?.uuid),
authVersion: 5,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.threatdetection.get_assets(machine_types="ecs")
default_asset_bind = alicloud.threatdetection.AssetBind("default",
uuid=default.assets[0].uuid,
auth_version=5)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
"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
}
_default, err := threatdetection.GetAssets(ctx, &threatdetection.GetAssetsArgs{
MachineTypes: pulumi.StringRef("ecs"),
}, nil)
if err != nil {
return err
}
_, err = threatdetection.NewAssetBind(ctx, "default", &threatdetection.AssetBindArgs{
Uuid: pulumi.String(_default.Assets[0].Uuid),
AuthVersion: pulumi.Int(5),
})
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 = AliCloud.ThreatDetection.GetAssets.Invoke(new()
{
MachineTypes = "ecs",
});
var defaultAssetBind = new AliCloud.ThreatDetection.AssetBind("default", new()
{
Uuid = @default.Apply(@default => @default.Apply(getAssetsResult => getAssetsResult.Assets[0]?.Uuid)),
AuthVersion = 5,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.threatdetection.ThreatdetectionFunctions;
import com.pulumi.alicloud.threatdetection.inputs.GetAssetsArgs;
import com.pulumi.alicloud.threatdetection.AssetBind;
import com.pulumi.alicloud.threatdetection.AssetBindArgs;
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");
final var default = ThreatdetectionFunctions.getAssets(GetAssetsArgs.builder()
.machineTypes("ecs")
.build());
var defaultAssetBind = new AssetBind("defaultAssetBind", AssetBindArgs.builder()
.uuid(default_.assets()[0].uuid())
.authVersion(5)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
defaultAssetBind:
type: alicloud:threatdetection:AssetBind
name: default
properties:
uuid: ${default.assets[0].uuid}
authVersion: '5'
variables:
default:
fn::invoke:
function: alicloud:threatdetection:getAssets
arguments:
machineTypes: ecs
Deleting alicloud.threatdetection.AssetBind or removing it from your configuration
Terraform cannot destroy resource alicloud.threatdetection.AssetBind. Terraform will remove this resource from the state file, however resources may remain.
📚 Need more examples? VIEW MORE EXAMPLES
Create AssetBind Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AssetBind(name: string, args?: AssetBindArgs, opts?: CustomResourceOptions);@overload
def AssetBind(resource_name: str,
args: Optional[AssetBindArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def AssetBind(resource_name: str,
opts: Optional[ResourceOptions] = None,
auth_version: Optional[int] = None,
uuid: Optional[str] = None)func NewAssetBind(ctx *Context, name string, args *AssetBindArgs, opts ...ResourceOption) (*AssetBind, error)public AssetBind(string name, AssetBindArgs? args = null, CustomResourceOptions? opts = null)
public AssetBind(String name, AssetBindArgs args)
public AssetBind(String name, AssetBindArgs args, CustomResourceOptions options)
type: alicloud:threatdetection:AssetBind
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 AssetBindArgs
- 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 AssetBindArgs
- 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 AssetBindArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AssetBindArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AssetBindArgs
- 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 assetBindResource = new AliCloud.ThreatDetection.AssetBind("assetBindResource", new()
{
AuthVersion = 0,
Uuid = "string",
});
example, err := threatdetection.NewAssetBind(ctx, "assetBindResource", &threatdetection.AssetBindArgs{
AuthVersion: pulumi.Int(0),
Uuid: pulumi.String("string"),
})
var assetBindResource = new AssetBind("assetBindResource", AssetBindArgs.builder()
.authVersion(0)
.uuid("string")
.build());
asset_bind_resource = alicloud.threatdetection.AssetBind("assetBindResource",
auth_version=0,
uuid="string")
const assetBindResource = new alicloud.threatdetection.AssetBind("assetBindResource", {
authVersion: 0,
uuid: "string",
});
type: alicloud:threatdetection:AssetBind
properties:
authVersion: 0
uuid: string
AssetBind 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 AssetBind resource accepts the following input properties:
- Auth
Version int - Bind version.
- Uuid string
- The first ID of the resource
- Auth
Version int - Bind version.
- Uuid string
- The first ID of the resource
- auth
Version Integer - Bind version.
- uuid String
- The first ID of the resource
- auth
Version number - Bind version.
- uuid string
- The first ID of the resource
- auth_
version int - Bind version.
- uuid str
- The first ID of the resource
- auth
Version Number - Bind version.
- uuid String
- The first ID of the resource
Outputs
All input properties are implicitly available as output properties. Additionally, the AssetBind 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 AssetBind Resource
Get an existing AssetBind 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?: AssetBindState, opts?: CustomResourceOptions): AssetBind@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auth_version: Optional[int] = None,
uuid: Optional[str] = None) -> AssetBindfunc GetAssetBind(ctx *Context, name string, id IDInput, state *AssetBindState, opts ...ResourceOption) (*AssetBind, error)public static AssetBind Get(string name, Input<string> id, AssetBindState? state, CustomResourceOptions? opts = null)public static AssetBind get(String name, Output<String> id, AssetBindState state, CustomResourceOptions options)resources: _: type: alicloud:threatdetection:AssetBind get: id: ${id}- 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.
- Auth
Version int - Bind version.
- Uuid string
- The first ID of the resource
- Auth
Version int - Bind version.
- Uuid string
- The first ID of the resource
- auth
Version Integer - Bind version.
- uuid String
- The first ID of the resource
- auth
Version number - Bind version.
- uuid string
- The first ID of the resource
- auth_
version int - Bind version.
- uuid str
- The first ID of the resource
- auth
Version Number - Bind version.
- uuid String
- The first ID of the resource
Import
Threat Detection Asset Bind can be imported using the id, e.g.
$ pulumi import alicloud:threatdetection/assetBind:AssetBind example <id>
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
alicloudTerraform Provider.
