AmiLaunchPermission

Adds launch permission to Amazon Machine Image (AMI) from another AWS account.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Ec2.AmiLaunchPermission("example", new Aws.Ec2.AmiLaunchPermissionArgs
        {
            AccountId = "123456789012",
            ImageId = "ami-12345678",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewAmiLaunchPermission(ctx, "example", &ec2.AmiLaunchPermissionArgs{
			AccountId: pulumi.String("123456789012"),
			ImageId:   pulumi.String("ami-12345678"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.ec2.AmiLaunchPermission("example",
    account_id="123456789012",
    image_id="ami-12345678")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ec2.AmiLaunchPermission("example", {
    accountId: "123456789012",
    imageId: "ami-12345678",
});

Create a AmiLaunchPermission Resource

new AmiLaunchPermission(name: string, args: AmiLaunchPermissionArgs, opts?: CustomResourceOptions);
@overload
def AmiLaunchPermission(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        account_id: Optional[str] = None,
                        image_id: Optional[str] = None)
@overload
def AmiLaunchPermission(resource_name: str,
                        args: AmiLaunchPermissionArgs,
                        opts: Optional[ResourceOptions] = None)
func NewAmiLaunchPermission(ctx *Context, name string, args AmiLaunchPermissionArgs, opts ...ResourceOption) (*AmiLaunchPermission, error)
public AmiLaunchPermission(string name, AmiLaunchPermissionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AmiLaunchPermissionArgs
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 AmiLaunchPermissionArgs
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 AmiLaunchPermissionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AmiLaunchPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AmiLaunchPermission Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The AmiLaunchPermission resource accepts the following input properties:

AccountId string
An AWS Account ID to add launch permissions.
ImageId string
A region-unique name for the AMI.
AccountId string
An AWS Account ID to add launch permissions.
ImageId string
A region-unique name for the AMI.
accountId string
An AWS Account ID to add launch permissions.
imageId string
A region-unique name for the AMI.
account_id str
An AWS Account ID to add launch permissions.
image_id str
A region-unique name for the AMI.

Outputs

All input properties are implicitly available as output properties. Additionally, the AmiLaunchPermission 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing AmiLaunchPermission Resource

Get an existing AmiLaunchPermission 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?: AmiLaunchPermissionState, opts?: CustomResourceOptions): AmiLaunchPermission
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        image_id: Optional[str] = None) -> AmiLaunchPermission
func GetAmiLaunchPermission(ctx *Context, name string, id IDInput, state *AmiLaunchPermissionState, opts ...ResourceOption) (*AmiLaunchPermission, error)
public static AmiLaunchPermission Get(string name, Input<string> id, AmiLaunchPermissionState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

AccountId string
An AWS Account ID to add launch permissions.
ImageId string
A region-unique name for the AMI.
AccountId string
An AWS Account ID to add launch permissions.
ImageId string
A region-unique name for the AMI.
accountId string
An AWS Account ID to add launch permissions.
imageId string
A region-unique name for the AMI.
account_id str
An AWS Account ID to add launch permissions.
image_id str
A region-unique name for the AMI.

Import

AWS AMI Launch Permission can be imported using the ACCOUNT-ID/IMAGE-ID, e.g.

 $ pulumi import aws:ec2/amiLaunchPermission:AmiLaunchPermission example 123456789012/ami-12345678

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.