github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/inspector2/delegatedAdminAccount.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package inspector2 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Resource for managing an Amazon Inspector Delegated Admin Account. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/inspector2" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // current, err := aws.GetCallerIdentity(ctx, nil, nil) 36 // if err != nil { 37 // return err 38 // } 39 // _, err = inspector2.NewDelegatedAdminAccount(ctx, "example", &inspector2.DelegatedAdminAccountArgs{ 40 // AccountId: pulumi.String(current.AccountId), 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 // 52 // ## Import 53 // 54 // Using `pulumi import`, import Inspector Delegated Admin Account using the `account_id`. For example: 55 // 56 // ```sh 57 // $ pulumi import aws:inspector2/delegatedAdminAccount:DelegatedAdminAccount example 012345678901 58 // ``` 59 type DelegatedAdminAccount struct { 60 pulumi.CustomResourceState 61 62 // Account to enable as delegated admin account. 63 AccountId pulumi.StringOutput `pulumi:"accountId"` 64 // Status of this delegated admin account. 65 RelationshipStatus pulumi.StringOutput `pulumi:"relationshipStatus"` 66 } 67 68 // NewDelegatedAdminAccount registers a new resource with the given unique name, arguments, and options. 69 func NewDelegatedAdminAccount(ctx *pulumi.Context, 70 name string, args *DelegatedAdminAccountArgs, opts ...pulumi.ResourceOption) (*DelegatedAdminAccount, error) { 71 if args == nil { 72 return nil, errors.New("missing one or more required arguments") 73 } 74 75 if args.AccountId == nil { 76 return nil, errors.New("invalid value for required argument 'AccountId'") 77 } 78 opts = internal.PkgResourceDefaultOpts(opts) 79 var resource DelegatedAdminAccount 80 err := ctx.RegisterResource("aws:inspector2/delegatedAdminAccount:DelegatedAdminAccount", name, args, &resource, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return &resource, nil 85 } 86 87 // GetDelegatedAdminAccount gets an existing DelegatedAdminAccount resource's state with the given name, ID, and optional 88 // state properties that are used to uniquely qualify the lookup (nil if not required). 89 func GetDelegatedAdminAccount(ctx *pulumi.Context, 90 name string, id pulumi.IDInput, state *DelegatedAdminAccountState, opts ...pulumi.ResourceOption) (*DelegatedAdminAccount, error) { 91 var resource DelegatedAdminAccount 92 err := ctx.ReadResource("aws:inspector2/delegatedAdminAccount:DelegatedAdminAccount", name, id, state, &resource, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return &resource, nil 97 } 98 99 // Input properties used for looking up and filtering DelegatedAdminAccount resources. 100 type delegatedAdminAccountState struct { 101 // Account to enable as delegated admin account. 102 AccountId *string `pulumi:"accountId"` 103 // Status of this delegated admin account. 104 RelationshipStatus *string `pulumi:"relationshipStatus"` 105 } 106 107 type DelegatedAdminAccountState struct { 108 // Account to enable as delegated admin account. 109 AccountId pulumi.StringPtrInput 110 // Status of this delegated admin account. 111 RelationshipStatus pulumi.StringPtrInput 112 } 113 114 func (DelegatedAdminAccountState) ElementType() reflect.Type { 115 return reflect.TypeOf((*delegatedAdminAccountState)(nil)).Elem() 116 } 117 118 type delegatedAdminAccountArgs struct { 119 // Account to enable as delegated admin account. 120 AccountId string `pulumi:"accountId"` 121 } 122 123 // The set of arguments for constructing a DelegatedAdminAccount resource. 124 type DelegatedAdminAccountArgs struct { 125 // Account to enable as delegated admin account. 126 AccountId pulumi.StringInput 127 } 128 129 func (DelegatedAdminAccountArgs) ElementType() reflect.Type { 130 return reflect.TypeOf((*delegatedAdminAccountArgs)(nil)).Elem() 131 } 132 133 type DelegatedAdminAccountInput interface { 134 pulumi.Input 135 136 ToDelegatedAdminAccountOutput() DelegatedAdminAccountOutput 137 ToDelegatedAdminAccountOutputWithContext(ctx context.Context) DelegatedAdminAccountOutput 138 } 139 140 func (*DelegatedAdminAccount) ElementType() reflect.Type { 141 return reflect.TypeOf((**DelegatedAdminAccount)(nil)).Elem() 142 } 143 144 func (i *DelegatedAdminAccount) ToDelegatedAdminAccountOutput() DelegatedAdminAccountOutput { 145 return i.ToDelegatedAdminAccountOutputWithContext(context.Background()) 146 } 147 148 func (i *DelegatedAdminAccount) ToDelegatedAdminAccountOutputWithContext(ctx context.Context) DelegatedAdminAccountOutput { 149 return pulumi.ToOutputWithContext(ctx, i).(DelegatedAdminAccountOutput) 150 } 151 152 // DelegatedAdminAccountArrayInput is an input type that accepts DelegatedAdminAccountArray and DelegatedAdminAccountArrayOutput values. 153 // You can construct a concrete instance of `DelegatedAdminAccountArrayInput` via: 154 // 155 // DelegatedAdminAccountArray{ DelegatedAdminAccountArgs{...} } 156 type DelegatedAdminAccountArrayInput interface { 157 pulumi.Input 158 159 ToDelegatedAdminAccountArrayOutput() DelegatedAdminAccountArrayOutput 160 ToDelegatedAdminAccountArrayOutputWithContext(context.Context) DelegatedAdminAccountArrayOutput 161 } 162 163 type DelegatedAdminAccountArray []DelegatedAdminAccountInput 164 165 func (DelegatedAdminAccountArray) ElementType() reflect.Type { 166 return reflect.TypeOf((*[]*DelegatedAdminAccount)(nil)).Elem() 167 } 168 169 func (i DelegatedAdminAccountArray) ToDelegatedAdminAccountArrayOutput() DelegatedAdminAccountArrayOutput { 170 return i.ToDelegatedAdminAccountArrayOutputWithContext(context.Background()) 171 } 172 173 func (i DelegatedAdminAccountArray) ToDelegatedAdminAccountArrayOutputWithContext(ctx context.Context) DelegatedAdminAccountArrayOutput { 174 return pulumi.ToOutputWithContext(ctx, i).(DelegatedAdminAccountArrayOutput) 175 } 176 177 // DelegatedAdminAccountMapInput is an input type that accepts DelegatedAdminAccountMap and DelegatedAdminAccountMapOutput values. 178 // You can construct a concrete instance of `DelegatedAdminAccountMapInput` via: 179 // 180 // DelegatedAdminAccountMap{ "key": DelegatedAdminAccountArgs{...} } 181 type DelegatedAdminAccountMapInput interface { 182 pulumi.Input 183 184 ToDelegatedAdminAccountMapOutput() DelegatedAdminAccountMapOutput 185 ToDelegatedAdminAccountMapOutputWithContext(context.Context) DelegatedAdminAccountMapOutput 186 } 187 188 type DelegatedAdminAccountMap map[string]DelegatedAdminAccountInput 189 190 func (DelegatedAdminAccountMap) ElementType() reflect.Type { 191 return reflect.TypeOf((*map[string]*DelegatedAdminAccount)(nil)).Elem() 192 } 193 194 func (i DelegatedAdminAccountMap) ToDelegatedAdminAccountMapOutput() DelegatedAdminAccountMapOutput { 195 return i.ToDelegatedAdminAccountMapOutputWithContext(context.Background()) 196 } 197 198 func (i DelegatedAdminAccountMap) ToDelegatedAdminAccountMapOutputWithContext(ctx context.Context) DelegatedAdminAccountMapOutput { 199 return pulumi.ToOutputWithContext(ctx, i).(DelegatedAdminAccountMapOutput) 200 } 201 202 type DelegatedAdminAccountOutput struct{ *pulumi.OutputState } 203 204 func (DelegatedAdminAccountOutput) ElementType() reflect.Type { 205 return reflect.TypeOf((**DelegatedAdminAccount)(nil)).Elem() 206 } 207 208 func (o DelegatedAdminAccountOutput) ToDelegatedAdminAccountOutput() DelegatedAdminAccountOutput { 209 return o 210 } 211 212 func (o DelegatedAdminAccountOutput) ToDelegatedAdminAccountOutputWithContext(ctx context.Context) DelegatedAdminAccountOutput { 213 return o 214 } 215 216 // Account to enable as delegated admin account. 217 func (o DelegatedAdminAccountOutput) AccountId() pulumi.StringOutput { 218 return o.ApplyT(func(v *DelegatedAdminAccount) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput) 219 } 220 221 // Status of this delegated admin account. 222 func (o DelegatedAdminAccountOutput) RelationshipStatus() pulumi.StringOutput { 223 return o.ApplyT(func(v *DelegatedAdminAccount) pulumi.StringOutput { return v.RelationshipStatus }).(pulumi.StringOutput) 224 } 225 226 type DelegatedAdminAccountArrayOutput struct{ *pulumi.OutputState } 227 228 func (DelegatedAdminAccountArrayOutput) ElementType() reflect.Type { 229 return reflect.TypeOf((*[]*DelegatedAdminAccount)(nil)).Elem() 230 } 231 232 func (o DelegatedAdminAccountArrayOutput) ToDelegatedAdminAccountArrayOutput() DelegatedAdminAccountArrayOutput { 233 return o 234 } 235 236 func (o DelegatedAdminAccountArrayOutput) ToDelegatedAdminAccountArrayOutputWithContext(ctx context.Context) DelegatedAdminAccountArrayOutput { 237 return o 238 } 239 240 func (o DelegatedAdminAccountArrayOutput) Index(i pulumi.IntInput) DelegatedAdminAccountOutput { 241 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DelegatedAdminAccount { 242 return vs[0].([]*DelegatedAdminAccount)[vs[1].(int)] 243 }).(DelegatedAdminAccountOutput) 244 } 245 246 type DelegatedAdminAccountMapOutput struct{ *pulumi.OutputState } 247 248 func (DelegatedAdminAccountMapOutput) ElementType() reflect.Type { 249 return reflect.TypeOf((*map[string]*DelegatedAdminAccount)(nil)).Elem() 250 } 251 252 func (o DelegatedAdminAccountMapOutput) ToDelegatedAdminAccountMapOutput() DelegatedAdminAccountMapOutput { 253 return o 254 } 255 256 func (o DelegatedAdminAccountMapOutput) ToDelegatedAdminAccountMapOutputWithContext(ctx context.Context) DelegatedAdminAccountMapOutput { 257 return o 258 } 259 260 func (o DelegatedAdminAccountMapOutput) MapIndex(k pulumi.StringInput) DelegatedAdminAccountOutput { 261 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DelegatedAdminAccount { 262 return vs[0].(map[string]*DelegatedAdminAccount)[vs[1].(string)] 263 }).(DelegatedAdminAccountOutput) 264 } 265 266 func init() { 267 pulumi.RegisterInputType(reflect.TypeOf((*DelegatedAdminAccountInput)(nil)).Elem(), &DelegatedAdminAccount{}) 268 pulumi.RegisterInputType(reflect.TypeOf((*DelegatedAdminAccountArrayInput)(nil)).Elem(), DelegatedAdminAccountArray{}) 269 pulumi.RegisterInputType(reflect.TypeOf((*DelegatedAdminAccountMapInput)(nil)).Elem(), DelegatedAdminAccountMap{}) 270 pulumi.RegisterOutputType(DelegatedAdminAccountOutput{}) 271 pulumi.RegisterOutputType(DelegatedAdminAccountArrayOutput{}) 272 pulumi.RegisterOutputType(DelegatedAdminAccountMapOutput{}) 273 }