1. Packages
  2. AWS
  3. API Docs
  4. securityhub
  5. InviteAccepter
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.securityhub.InviteAccepter

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Note: AWS accounts can only be associated with a single Security Hub master account. Destroying this resource will disassociate the member account from the master account.

    Accepts a Security Hub invitation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.securityhub.Account("example", {});
    const exampleMember = new aws.securityhub.Member("example", {
        accountId: "123456789012",
        email: "example@example.com",
        invite: true,
    });
    const invitee = new aws.securityhub.Account("invitee", {});
    const inviteeInviteAccepter = new aws.securityhub.InviteAccepter("invitee", {masterId: exampleMember.masterId}, {
        dependsOn: [invitee],
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.securityhub.Account("example")
    example_member = aws.securityhub.Member("example",
        account_id="123456789012",
        email="example@example.com",
        invite=True)
    invitee = aws.securityhub.Account("invitee")
    invitee_invite_accepter = aws.securityhub.InviteAccepter("invitee", master_id=example_member.master_id,
    opts = pulumi.ResourceOptions(depends_on=[invitee]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/securityhub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := securityhub.NewAccount(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		exampleMember, err := securityhub.NewMember(ctx, "example", &securityhub.MemberArgs{
    			AccountId: pulumi.String("123456789012"),
    			Email:     pulumi.String("example@example.com"),
    			Invite:    pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		invitee, err := securityhub.NewAccount(ctx, "invitee", nil)
    		if err != nil {
    			return err
    		}
    		_, err = securityhub.NewInviteAccepter(ctx, "invitee", &securityhub.InviteAccepterArgs{
    			MasterId: exampleMember.MasterId,
    		}, pulumi.DependsOn([]pulumi.Resource{
    			invitee,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.SecurityHub.Account("example");
    
        var exampleMember = new Aws.SecurityHub.Member("example", new()
        {
            AccountId = "123456789012",
            Email = "example@example.com",
            Invite = true,
        });
    
        var invitee = new Aws.SecurityHub.Account("invitee");
    
        var inviteeInviteAccepter = new Aws.SecurityHub.InviteAccepter("invitee", new()
        {
            MasterId = exampleMember.MasterId,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                invitee,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.securityhub.Account;
    import com.pulumi.aws.securityhub.Member;
    import com.pulumi.aws.securityhub.MemberArgs;
    import com.pulumi.aws.securityhub.InviteAccepter;
    import com.pulumi.aws.securityhub.InviteAccepterArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 Account("example");
    
            var exampleMember = new Member("exampleMember", MemberArgs.builder()
                .accountId("123456789012")
                .email("example@example.com")
                .invite(true)
                .build());
    
            var invitee = new Account("invitee");
    
            var inviteeInviteAccepter = new InviteAccepter("inviteeInviteAccepter", InviteAccepterArgs.builder()
                .masterId(exampleMember.masterId())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(invitee)
                    .build());
    
        }
    }
    
    resources:
      example:
        type: aws:securityhub:Account
      exampleMember:
        type: aws:securityhub:Member
        name: example
        properties:
          accountId: '123456789012'
          email: example@example.com
          invite: true
      invitee:
        type: aws:securityhub:Account
      inviteeInviteAccepter:
        type: aws:securityhub:InviteAccepter
        name: invitee
        properties:
          masterId: ${exampleMember.masterId}
        options:
          dependson:
            - ${invitee}
    

    Create InviteAccepter Resource

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

    Constructor syntax

    new InviteAccepter(name: string, args: InviteAccepterArgs, opts?: CustomResourceOptions);
    @overload
    def InviteAccepter(resource_name: str,
                       args: InviteAccepterArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def InviteAccepter(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       master_id: Optional[str] = None)
    func NewInviteAccepter(ctx *Context, name string, args InviteAccepterArgs, opts ...ResourceOption) (*InviteAccepter, error)
    public InviteAccepter(string name, InviteAccepterArgs args, CustomResourceOptions? opts = null)
    public InviteAccepter(String name, InviteAccepterArgs args)
    public InviteAccepter(String name, InviteAccepterArgs args, CustomResourceOptions options)
    
    type: aws:securityhub:InviteAccepter
    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 InviteAccepterArgs
    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 InviteAccepterArgs
    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 InviteAccepterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args InviteAccepterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args InviteAccepterArgs
    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 awsInviteAccepterResource = new Aws.SecurityHub.InviteAccepter("awsInviteAccepterResource", new()
    {
        MasterId = "string",
    });
    
    example, err := securityhub.NewInviteAccepter(ctx, "awsInviteAccepterResource", &securityhub.InviteAccepterArgs{
    	MasterId: pulumi.String("string"),
    })
    
    var awsInviteAccepterResource = new InviteAccepter("awsInviteAccepterResource", InviteAccepterArgs.builder()
        .masterId("string")
        .build());
    
    aws_invite_accepter_resource = aws.securityhub.InviteAccepter("awsInviteAccepterResource", master_id="string")
    
    const awsInviteAccepterResource = new aws.securityhub.InviteAccepter("awsInviteAccepterResource", {masterId: "string"});
    
    type: aws:securityhub:InviteAccepter
    properties:
        masterId: string
    

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

    MasterId string
    The account ID of the master Security Hub account whose invitation you're accepting.
    MasterId string
    The account ID of the master Security Hub account whose invitation you're accepting.
    masterId String
    The account ID of the master Security Hub account whose invitation you're accepting.
    masterId string
    The account ID of the master Security Hub account whose invitation you're accepting.
    master_id str
    The account ID of the master Security Hub account whose invitation you're accepting.
    masterId String
    The account ID of the master Security Hub account whose invitation you're accepting.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the InviteAccepter resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    InvitationId string
    The ID of the invitation.
    Id string
    The provider-assigned unique ID for this managed resource.
    InvitationId string
    The ID of the invitation.
    id String
    The provider-assigned unique ID for this managed resource.
    invitationId String
    The ID of the invitation.
    id string
    The provider-assigned unique ID for this managed resource.
    invitationId string
    The ID of the invitation.
    id str
    The provider-assigned unique ID for this managed resource.
    invitation_id str
    The ID of the invitation.
    id String
    The provider-assigned unique ID for this managed resource.
    invitationId String
    The ID of the invitation.

    Look up Existing InviteAccepter Resource

    Get an existing InviteAccepter 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?: InviteAccepterState, opts?: CustomResourceOptions): InviteAccepter
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            invitation_id: Optional[str] = None,
            master_id: Optional[str] = None) -> InviteAccepter
    func GetInviteAccepter(ctx *Context, name string, id IDInput, state *InviteAccepterState, opts ...ResourceOption) (*InviteAccepter, error)
    public static InviteAccepter Get(string name, Input<string> id, InviteAccepterState? state, CustomResourceOptions? opts = null)
    public static InviteAccepter get(String name, Output<String> id, InviteAccepterState 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:
    InvitationId string
    The ID of the invitation.
    MasterId string
    The account ID of the master Security Hub account whose invitation you're accepting.
    InvitationId string
    The ID of the invitation.
    MasterId string
    The account ID of the master Security Hub account whose invitation you're accepting.
    invitationId String
    The ID of the invitation.
    masterId String
    The account ID of the master Security Hub account whose invitation you're accepting.
    invitationId string
    The ID of the invitation.
    masterId string
    The account ID of the master Security Hub account whose invitation you're accepting.
    invitation_id str
    The ID of the invitation.
    master_id str
    The account ID of the master Security Hub account whose invitation you're accepting.
    invitationId String
    The ID of the invitation.
    masterId String
    The account ID of the master Security Hub account whose invitation you're accepting.

    Import

    Using pulumi import, import Security Hub invite acceptance using the account ID. For example:

    $ pulumi import aws:securityhub/inviteAccepter:InviteAccepter example 123456789012
    

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

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi