AmiLaunchPermission

Adds a launch permission to an Amazon Machine Image (AMI).

Example Usage

AWS Account ID

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Ec2.AmiLaunchPermission("example", new()
    {
        AccountId = "123456789012",
        ImageId = "ami-12345678",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.AmiLaunchPermission;
import com.pulumi.aws.ec2.AmiLaunchPermissionArgs;
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 example = new AmiLaunchPermission("example", AmiLaunchPermissionArgs.builder()        
            .accountId("123456789012")
            .imageId("ami-12345678")
            .build());

    }
}
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",
});
resources:
  example:
    type: aws:ec2:AmiLaunchPermission
    properties:
      accountId: '123456789012'
      imageId: ami-12345678

Public Access

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Ec2.AmiLaunchPermission("example", new()
    {
        Group = "all",
        ImageId = "ami-12345678",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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{
			Group:   pulumi.String("all"),
			ImageId: pulumi.String("ami-12345678"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.AmiLaunchPermission;
import com.pulumi.aws.ec2.AmiLaunchPermissionArgs;
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 example = new AmiLaunchPermission("example", AmiLaunchPermissionArgs.builder()        
            .group("all")
            .imageId("ami-12345678")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

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

const example = new aws.ec2.AmiLaunchPermission("example", {
    group: "all",
    imageId: "ami-12345678",
});
resources:
  example:
    type: aws:ec2:AmiLaunchPermission
    properties:
      group: all
      imageId: ami-12345678

Create 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,
                        group: Optional[str] = None,
                        image_id: Optional[str] = None,
                        organization_arn: Optional[str] = None,
                        organizational_unit_arn: 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)
public AmiLaunchPermission(String name, AmiLaunchPermissionArgs args)
public AmiLaunchPermission(String name, AmiLaunchPermissionArgs args, CustomResourceOptions options)
type: aws:ec2:AmiLaunchPermission
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args AmiLaunchPermissionArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The AmiLaunchPermission resource accepts the following input properties:

ImageId string

ID of the AMI.

AccountId string

AWS account ID for the launch permission.

Group string

Name of the group for the launch permission. Valid values: "all".

OrganizationArn string

ARN of an organization for the launch permission.

OrganizationalUnitArn string

ARN of an organizational unit for the launch permission.

ImageId string

ID of the AMI.

AccountId string

AWS account ID for the launch permission.

Group string

Name of the group for the launch permission. Valid values: "all".

OrganizationArn string

ARN of an organization for the launch permission.

OrganizationalUnitArn string

ARN of an organizational unit for the launch permission.

imageId String

ID of the AMI.

accountId String

AWS account ID for the launch permission.

group String

Name of the group for the launch permission. Valid values: "all".

organizationArn String

ARN of an organization for the launch permission.

organizationalUnitArn String

ARN of an organizational unit for the launch permission.

imageId string

ID of the AMI.

accountId string

AWS account ID for the launch permission.

group string

Name of the group for the launch permission. Valid values: "all".

organizationArn string

ARN of an organization for the launch permission.

organizationalUnitArn string

ARN of an organizational unit for the launch permission.

image_id str

ID of the AMI.

account_id str

AWS account ID for the launch permission.

group str

Name of the group for the launch permission. Valid values: "all".

organization_arn str

ARN of an organization for the launch permission.

organizational_unit_arn str

ARN of an organizational unit for the launch permission.

imageId String

ID of the AMI.

accountId String

AWS account ID for the launch permission.

group String

Name of the group for the launch permission. Valid values: "all".

organizationArn String

ARN of an organization for the launch permission.

organizationalUnitArn String

ARN of an organizational unit for the launch permission.

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 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 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,
        group: Optional[str] = None,
        image_id: Optional[str] = None,
        organization_arn: Optional[str] = None,
        organizational_unit_arn: 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)
public static AmiLaunchPermission get(String name, Output<String> id, AmiLaunchPermissionState 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:
AccountId string

AWS account ID for the launch permission.

Group string

Name of the group for the launch permission. Valid values: "all".

ImageId string

ID of the AMI.

OrganizationArn string

ARN of an organization for the launch permission.

OrganizationalUnitArn string

ARN of an organizational unit for the launch permission.

AccountId string

AWS account ID for the launch permission.

Group string

Name of the group for the launch permission. Valid values: "all".

ImageId string

ID of the AMI.

OrganizationArn string

ARN of an organization for the launch permission.

OrganizationalUnitArn string

ARN of an organizational unit for the launch permission.

accountId String

AWS account ID for the launch permission.

group String

Name of the group for the launch permission. Valid values: "all".

imageId String

ID of the AMI.

organizationArn String

ARN of an organization for the launch permission.

organizationalUnitArn String

ARN of an organizational unit for the launch permission.

accountId string

AWS account ID for the launch permission.

group string

Name of the group for the launch permission. Valid values: "all".

imageId string

ID of the AMI.

organizationArn string

ARN of an organization for the launch permission.

organizationalUnitArn string

ARN of an organizational unit for the launch permission.

account_id str

AWS account ID for the launch permission.

group str

Name of the group for the launch permission. Valid values: "all".

image_id str

ID of the AMI.

organization_arn str

ARN of an organization for the launch permission.

organizational_unit_arn str

ARN of an organizational unit for the launch permission.

accountId String

AWS account ID for the launch permission.

group String

Name of the group for the launch permission. Valid values: "all".

imageId String

ID of the AMI.

organizationArn String

ARN of an organization for the launch permission.

organizationalUnitArn String

ARN of an organizational unit for the launch permission.

Import

AMI Launch Permissions can be imported using [ACCOUNT-ID|GROUP-NAME|ORGANIZATION-ARN|ORGANIZATIONAL-UNIT-ARN]/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.