pulumi_wasm_providers_aws_mini::ec2

Module ami_launch_permission

source
Expand description

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

§Example Usage

§AWS Account ID

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let example = ami_launch_permission::create(
        "example",
        AmiLaunchPermissionArgs::builder()
            .account_id("123456789012")
            .image_id("ami-12345678")
            .build_struct(),
    );
}

§Public Access

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let example = ami_launch_permission::create(
        "example",
        AmiLaunchPermissionArgs::builder()
            .group("all")
            .image_id("ami-12345678")
            .build_struct(),
    );
}

§Organization Access

resources:
  example:
    type: aws:ec2:AmiLaunchPermission
    properties:
      imageId: ami-12345678
      organizationArn: ${current.arn}
variables:
  current:
    fn::invoke:
      function: aws:organizations:getOrganization
      arguments: {}

§Import

Using pulumi import, import AMI Launch Permissions using [ACCOUNT-ID|GROUP-NAME|ORGANIZATION-ARN|ORGANIZATIONAL-UNIT-ARN]/IMAGE-ID. For example:

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

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments