1. Packages
  2. Volcengine
  3. API Docs
  4. ecs
  5. ImageSharePermission
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.ecs.ImageSharePermission

Explore with Pulumi AI

Provides a resource to manage image share permission

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";

const fooImage = new volcengine.ecs.Image("fooImage", {
    imageName: "acc-test-image",
    description: "acc-test",
    instanceId: "i-ydi2q1s7wgqc6ild****",
    createWholeImage: false,
    projectName: "default",
    tags: [{
        key: "k1",
        value: "v1",
    }],
});
const fooImageSharePermission = new volcengine.ecs.ImageSharePermission("fooImageSharePermission", {
    imageId: fooImage.id,
    accountId: "21000*****",
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_image = volcengine.ecs.Image("fooImage",
    image_name="acc-test-image",
    description="acc-test",
    instance_id="i-ydi2q1s7wgqc6ild****",
    create_whole_image=False,
    project_name="default",
    tags=[volcengine.ecs.ImageTagArgs(
        key="k1",
        value="v1",
    )])
foo_image_share_permission = volcengine.ecs.ImageSharePermission("fooImageSharePermission",
    image_id=foo_image.id,
    account_id="21000*****")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooImage, err := ecs.NewImage(ctx, "fooImage", &ecs.ImageArgs{
			ImageName:        pulumi.String("acc-test-image"),
			Description:      pulumi.String("acc-test"),
			InstanceId:       pulumi.String("i-ydi2q1s7wgqc6ild****"),
			CreateWholeImage: pulumi.Bool(false),
			ProjectName:      pulumi.String("default"),
			Tags: ecs.ImageTagArray{
				&ecs.ImageTagArgs{
					Key:   pulumi.String("k1"),
					Value: pulumi.String("v1"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = ecs.NewImageSharePermission(ctx, "fooImageSharePermission", &ecs.ImageSharePermissionArgs{
			ImageId:   fooImage.ID(),
			AccountId: pulumi.String("21000*****"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooImage = new Volcengine.Ecs.Image("fooImage", new()
    {
        ImageName = "acc-test-image",
        Description = "acc-test",
        InstanceId = "i-ydi2q1s7wgqc6ild****",
        CreateWholeImage = false,
        ProjectName = "default",
        Tags = new[]
        {
            new Volcengine.Ecs.Inputs.ImageTagArgs
            {
                Key = "k1",
                Value = "v1",
            },
        },
    });

    var fooImageSharePermission = new Volcengine.Ecs.ImageSharePermission("fooImageSharePermission", new()
    {
        ImageId = fooImage.Id,
        AccountId = "21000*****",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.Image;
import com.pulumi.volcengine.ecs.ImageArgs;
import com.pulumi.volcengine.ecs.inputs.ImageTagArgs;
import com.pulumi.volcengine.ecs.ImageSharePermission;
import com.pulumi.volcengine.ecs.ImageSharePermissionArgs;
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 fooImage = new Image("fooImage", ImageArgs.builder()        
            .imageName("acc-test-image")
            .description("acc-test")
            .instanceId("i-ydi2q1s7wgqc6ild****")
            .createWholeImage(false)
            .projectName("default")
            .tags(ImageTagArgs.builder()
                .key("k1")
                .value("v1")
                .build())
            .build());

        var fooImageSharePermission = new ImageSharePermission("fooImageSharePermission", ImageSharePermissionArgs.builder()        
            .imageId(fooImage.id())
            .accountId("21000*****")
            .build());

    }
}
Copy
resources:
  fooImage:
    type: volcengine:ecs:Image
    properties:
      imageName: acc-test-image
      description: acc-test
      instanceId: i-ydi2q1s7wgqc6ild****
      createWholeImage: false
      projectName: default
      tags:
        - key: k1
          value: v1
  fooImageSharePermission:
    type: volcengine:ecs:ImageSharePermission
    properties:
      imageId: ${fooImage.id}
      accountId: 21000*****
Copy

Create ImageSharePermission Resource

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

Constructor syntax

new ImageSharePermission(name: string, args: ImageSharePermissionArgs, opts?: CustomResourceOptions);
@overload
def ImageSharePermission(resource_name: str,
                         args: ImageSharePermissionArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def ImageSharePermission(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         account_id: Optional[str] = None,
                         image_id: Optional[str] = None)
func NewImageSharePermission(ctx *Context, name string, args ImageSharePermissionArgs, opts ...ResourceOption) (*ImageSharePermission, error)
public ImageSharePermission(string name, ImageSharePermissionArgs args, CustomResourceOptions? opts = null)
public ImageSharePermission(String name, ImageSharePermissionArgs args)
public ImageSharePermission(String name, ImageSharePermissionArgs args, CustomResourceOptions options)
type: volcengine:ecs:ImageSharePermission
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. ImageSharePermissionArgs
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. ImageSharePermissionArgs
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. ImageSharePermissionArgs
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. ImageSharePermissionArgs
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. ImageSharePermissionArgs
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 imageSharePermissionResource = new Volcengine.Ecs.ImageSharePermission("imageSharePermissionResource", new()
{
    AccountId = "string",
    ImageId = "string",
});
Copy
example, err := ecs.NewImageSharePermission(ctx, "imageSharePermissionResource", &ecs.ImageSharePermissionArgs{
	AccountId: pulumi.String("string"),
	ImageId:   pulumi.String("string"),
})
Copy
var imageSharePermissionResource = new ImageSharePermission("imageSharePermissionResource", ImageSharePermissionArgs.builder()
    .accountId("string")
    .imageId("string")
    .build());
Copy
image_share_permission_resource = volcengine.ecs.ImageSharePermission("imageSharePermissionResource",
    account_id="string",
    image_id="string")
Copy
const imageSharePermissionResource = new volcengine.ecs.ImageSharePermission("imageSharePermissionResource", {
    accountId: "string",
    imageId: "string",
});
Copy
type: volcengine:ecs:ImageSharePermission
properties:
    accountId: string
    imageId: string
Copy

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

AccountId
This property is required.
Changes to this property will trigger replacement.
string
The share account id of the image.
ImageId
This property is required.
Changes to this property will trigger replacement.
string
The id of the image.
AccountId
This property is required.
Changes to this property will trigger replacement.
string
The share account id of the image.
ImageId
This property is required.
Changes to this property will trigger replacement.
string
The id of the image.
accountId
This property is required.
Changes to this property will trigger replacement.
String
The share account id of the image.
imageId
This property is required.
Changes to this property will trigger replacement.
String
The id of the image.
accountId
This property is required.
Changes to this property will trigger replacement.
string
The share account id of the image.
imageId
This property is required.
Changes to this property will trigger replacement.
string
The id of the image.
account_id
This property is required.
Changes to this property will trigger replacement.
str
The share account id of the image.
image_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the image.
accountId
This property is required.
Changes to this property will trigger replacement.
String
The share account id of the image.
imageId
This property is required.
Changes to this property will trigger replacement.
String
The id of the image.

Outputs

All input properties are implicitly available as output properties. Additionally, the ImageSharePermission 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 ImageSharePermission Resource

Get an existing ImageSharePermission 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?: ImageSharePermissionState, opts?: CustomResourceOptions): ImageSharePermission
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        image_id: Optional[str] = None) -> ImageSharePermission
func GetImageSharePermission(ctx *Context, name string, id IDInput, state *ImageSharePermissionState, opts ...ResourceOption) (*ImageSharePermission, error)
public static ImageSharePermission Get(string name, Input<string> id, ImageSharePermissionState? state, CustomResourceOptions? opts = null)
public static ImageSharePermission get(String name, Output<String> id, ImageSharePermissionState state, CustomResourceOptions options)
resources:  _:    type: volcengine:ecs:ImageSharePermission    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:
AccountId Changes to this property will trigger replacement. string
The share account id of the image.
ImageId Changes to this property will trigger replacement. string
The id of the image.
AccountId Changes to this property will trigger replacement. string
The share account id of the image.
ImageId Changes to this property will trigger replacement. string
The id of the image.
accountId Changes to this property will trigger replacement. String
The share account id of the image.
imageId Changes to this property will trigger replacement. String
The id of the image.
accountId Changes to this property will trigger replacement. string
The share account id of the image.
imageId Changes to this property will trigger replacement. string
The id of the image.
account_id Changes to this property will trigger replacement. str
The share account id of the image.
image_id Changes to this property will trigger replacement. str
The id of the image.
accountId Changes to this property will trigger replacement. String
The share account id of the image.
imageId Changes to this property will trigger replacement. String
The id of the image.

Import

ImageSharePermission can be imported using the image_id:account_id, e.g.

$ pulumi import volcengine:ecs/imageSharePermission:ImageSharePermission default resource_id
Copy

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

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.