1. Packages
  2. AWS
  3. API Docs
  4. inspector2
  5. MemberAssociation
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.inspector2.MemberAssociation

Explore with Pulumi AI

Resource for associating accounts to existing Inspector instances.

Example Usage

Basic Usage

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

const example = new aws.inspector2.MemberAssociation("example", {accountId: "123456789012"});
Copy
import pulumi
import pulumi_aws as aws

example = aws.inspector2.MemberAssociation("example", account_id="123456789012")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/inspector2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := inspector2.NewMemberAssociation(ctx, "example", &inspector2.MemberAssociationArgs{
			AccountId: pulumi.String("123456789012"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Inspector2.MemberAssociation("example", new()
    {
        AccountId = "123456789012",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.inspector2.MemberAssociation;
import com.pulumi.aws.inspector2.MemberAssociationArgs;
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 MemberAssociation("example", MemberAssociationArgs.builder()
            .accountId("123456789012")
            .build());

    }
}
Copy
resources:
  example:
    type: aws:inspector2:MemberAssociation
    properties:
      accountId: '123456789012'
Copy

Create MemberAssociation Resource

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

Constructor syntax

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

@overload
def MemberAssociation(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      account_id: Optional[str] = None)
func NewMemberAssociation(ctx *Context, name string, args MemberAssociationArgs, opts ...ResourceOption) (*MemberAssociation, error)
public MemberAssociation(string name, MemberAssociationArgs args, CustomResourceOptions? opts = null)
public MemberAssociation(String name, MemberAssociationArgs args)
public MemberAssociation(String name, MemberAssociationArgs args, CustomResourceOptions options)
type: aws:inspector2:MemberAssociation
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. MemberAssociationArgs
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. MemberAssociationArgs
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. MemberAssociationArgs
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. MemberAssociationArgs
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. MemberAssociationArgs
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 memberAssociationResource = new Aws.Inspector2.MemberAssociation("memberAssociationResource", new()
{
    AccountId = "string",
});
Copy
example, err := inspector2.NewMemberAssociation(ctx, "memberAssociationResource", &inspector2.MemberAssociationArgs{
	AccountId: pulumi.String("string"),
})
Copy
var memberAssociationResource = new MemberAssociation("memberAssociationResource", MemberAssociationArgs.builder()
    .accountId("string")
    .build());
Copy
member_association_resource = aws.inspector2.MemberAssociation("memberAssociationResource", account_id="string")
Copy
const memberAssociationResource = new aws.inspector2.MemberAssociation("memberAssociationResource", {accountId: "string"});
Copy
type: aws:inspector2:MemberAssociation
properties:
    accountId: string
Copy

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

AccountId
This property is required.
Changes to this property will trigger replacement.
string
ID of the account to associate
AccountId
This property is required.
Changes to this property will trigger replacement.
string
ID of the account to associate
accountId
This property is required.
Changes to this property will trigger replacement.
String
ID of the account to associate
accountId
This property is required.
Changes to this property will trigger replacement.
string
ID of the account to associate
account_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the account to associate
accountId
This property is required.
Changes to this property will trigger replacement.
String
ID of the account to associate

Outputs

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

DelegatedAdminAccountId string
Account ID of the delegated administrator account
Id string
The provider-assigned unique ID for this managed resource.
RelationshipStatus string
Status of the member relationship
UpdatedAt string
Date and time of the last update of the relationship
DelegatedAdminAccountId string
Account ID of the delegated administrator account
Id string
The provider-assigned unique ID for this managed resource.
RelationshipStatus string
Status of the member relationship
UpdatedAt string
Date and time of the last update of the relationship
delegatedAdminAccountId String
Account ID of the delegated administrator account
id String
The provider-assigned unique ID for this managed resource.
relationshipStatus String
Status of the member relationship
updatedAt String
Date and time of the last update of the relationship
delegatedAdminAccountId string
Account ID of the delegated administrator account
id string
The provider-assigned unique ID for this managed resource.
relationshipStatus string
Status of the member relationship
updatedAt string
Date and time of the last update of the relationship
delegated_admin_account_id str
Account ID of the delegated administrator account
id str
The provider-assigned unique ID for this managed resource.
relationship_status str
Status of the member relationship
updated_at str
Date and time of the last update of the relationship
delegatedAdminAccountId String
Account ID of the delegated administrator account
id String
The provider-assigned unique ID for this managed resource.
relationshipStatus String
Status of the member relationship
updatedAt String
Date and time of the last update of the relationship

Look up Existing MemberAssociation Resource

Get an existing MemberAssociation 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?: MemberAssociationState, opts?: CustomResourceOptions): MemberAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        delegated_admin_account_id: Optional[str] = None,
        relationship_status: Optional[str] = None,
        updated_at: Optional[str] = None) -> MemberAssociation
func GetMemberAssociation(ctx *Context, name string, id IDInput, state *MemberAssociationState, opts ...ResourceOption) (*MemberAssociation, error)
public static MemberAssociation Get(string name, Input<string> id, MemberAssociationState? state, CustomResourceOptions? opts = null)
public static MemberAssociation get(String name, Output<String> id, MemberAssociationState state, CustomResourceOptions options)
resources:  _:    type: aws:inspector2:MemberAssociation    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
ID of the account to associate
DelegatedAdminAccountId string
Account ID of the delegated administrator account
RelationshipStatus string
Status of the member relationship
UpdatedAt string
Date and time of the last update of the relationship
AccountId Changes to this property will trigger replacement. string
ID of the account to associate
DelegatedAdminAccountId string
Account ID of the delegated administrator account
RelationshipStatus string
Status of the member relationship
UpdatedAt string
Date and time of the last update of the relationship
accountId Changes to this property will trigger replacement. String
ID of the account to associate
delegatedAdminAccountId String
Account ID of the delegated administrator account
relationshipStatus String
Status of the member relationship
updatedAt String
Date and time of the last update of the relationship
accountId Changes to this property will trigger replacement. string
ID of the account to associate
delegatedAdminAccountId string
Account ID of the delegated administrator account
relationshipStatus string
Status of the member relationship
updatedAt string
Date and time of the last update of the relationship
account_id Changes to this property will trigger replacement. str
ID of the account to associate
delegated_admin_account_id str
Account ID of the delegated administrator account
relationship_status str
Status of the member relationship
updated_at str
Date and time of the last update of the relationship
accountId Changes to this property will trigger replacement. String
ID of the account to associate
delegatedAdminAccountId String
Account ID of the delegated administrator account
relationshipStatus String
Status of the member relationship
updatedAt String
Date and time of the last update of the relationship

Import

Using pulumi import, import Amazon Inspector Member Association using the account_id. For example:

$ pulumi import aws:inspector2/memberAssociation:MemberAssociation example 123456789012
Copy

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.