github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssoadmin/accountAssignment.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 ssoadmin 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 // Provides a Single Sign-On (SSO) Account Assignment resource 16 // 17 // ## Example Usage 18 // 19 // ## Import 20 // 21 // Using `pulumi import`, import SSO Account Assignments using the `principal_id`, `principal_type`, `target_id`, `target_type`, `permission_set_arn`, `instance_arn` separated by commas (`,`). For example: 22 // 23 // ```sh 24 // $ pulumi import aws:ssoadmin/accountAssignment:AccountAssignment example f81d4fae-7dec-11d0-a765-00a0c91e6bf6,GROUP,1234567890,AWS_ACCOUNT,arn:aws:sso:::permissionSet/ssoins-0123456789abcdef/ps-0123456789abcdef,arn:aws:sso:::instance/ssoins-0123456789abcdef 25 // ``` 26 type AccountAssignment struct { 27 pulumi.CustomResourceState 28 29 // The Amazon Resource Name (ARN) of the SSO Instance. 30 InstanceArn pulumi.StringOutput `pulumi:"instanceArn"` 31 // The Amazon Resource Name (ARN) of the Permission Set that the admin wants to grant the principal access to. 32 PermissionSetArn pulumi.StringOutput `pulumi:"permissionSetArn"` 33 // An identifier for an object in SSO, such as a user or group. PrincipalIds are GUIDs (For example, `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). 34 PrincipalId pulumi.StringOutput `pulumi:"principalId"` 35 // The entity type for which the assignment will be created. Valid values: `USER`, `GROUP`. 36 PrincipalType pulumi.StringOutput `pulumi:"principalType"` 37 // An AWS account identifier, typically a 10-12 digit string. 38 TargetId pulumi.StringOutput `pulumi:"targetId"` 39 // The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. 40 TargetType pulumi.StringPtrOutput `pulumi:"targetType"` 41 } 42 43 // NewAccountAssignment registers a new resource with the given unique name, arguments, and options. 44 func NewAccountAssignment(ctx *pulumi.Context, 45 name string, args *AccountAssignmentArgs, opts ...pulumi.ResourceOption) (*AccountAssignment, error) { 46 if args == nil { 47 return nil, errors.New("missing one or more required arguments") 48 } 49 50 if args.InstanceArn == nil { 51 return nil, errors.New("invalid value for required argument 'InstanceArn'") 52 } 53 if args.PermissionSetArn == nil { 54 return nil, errors.New("invalid value for required argument 'PermissionSetArn'") 55 } 56 if args.PrincipalId == nil { 57 return nil, errors.New("invalid value for required argument 'PrincipalId'") 58 } 59 if args.PrincipalType == nil { 60 return nil, errors.New("invalid value for required argument 'PrincipalType'") 61 } 62 if args.TargetId == nil { 63 return nil, errors.New("invalid value for required argument 'TargetId'") 64 } 65 opts = internal.PkgResourceDefaultOpts(opts) 66 var resource AccountAssignment 67 err := ctx.RegisterResource("aws:ssoadmin/accountAssignment:AccountAssignment", name, args, &resource, opts...) 68 if err != nil { 69 return nil, err 70 } 71 return &resource, nil 72 } 73 74 // GetAccountAssignment gets an existing AccountAssignment resource's state with the given name, ID, and optional 75 // state properties that are used to uniquely qualify the lookup (nil if not required). 76 func GetAccountAssignment(ctx *pulumi.Context, 77 name string, id pulumi.IDInput, state *AccountAssignmentState, opts ...pulumi.ResourceOption) (*AccountAssignment, error) { 78 var resource AccountAssignment 79 err := ctx.ReadResource("aws:ssoadmin/accountAssignment:AccountAssignment", name, id, state, &resource, opts...) 80 if err != nil { 81 return nil, err 82 } 83 return &resource, nil 84 } 85 86 // Input properties used for looking up and filtering AccountAssignment resources. 87 type accountAssignmentState struct { 88 // The Amazon Resource Name (ARN) of the SSO Instance. 89 InstanceArn *string `pulumi:"instanceArn"` 90 // The Amazon Resource Name (ARN) of the Permission Set that the admin wants to grant the principal access to. 91 PermissionSetArn *string `pulumi:"permissionSetArn"` 92 // An identifier for an object in SSO, such as a user or group. PrincipalIds are GUIDs (For example, `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). 93 PrincipalId *string `pulumi:"principalId"` 94 // The entity type for which the assignment will be created. Valid values: `USER`, `GROUP`. 95 PrincipalType *string `pulumi:"principalType"` 96 // An AWS account identifier, typically a 10-12 digit string. 97 TargetId *string `pulumi:"targetId"` 98 // The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. 99 TargetType *string `pulumi:"targetType"` 100 } 101 102 type AccountAssignmentState struct { 103 // The Amazon Resource Name (ARN) of the SSO Instance. 104 InstanceArn pulumi.StringPtrInput 105 // The Amazon Resource Name (ARN) of the Permission Set that the admin wants to grant the principal access to. 106 PermissionSetArn pulumi.StringPtrInput 107 // An identifier for an object in SSO, such as a user or group. PrincipalIds are GUIDs (For example, `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). 108 PrincipalId pulumi.StringPtrInput 109 // The entity type for which the assignment will be created. Valid values: `USER`, `GROUP`. 110 PrincipalType pulumi.StringPtrInput 111 // An AWS account identifier, typically a 10-12 digit string. 112 TargetId pulumi.StringPtrInput 113 // The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. 114 TargetType pulumi.StringPtrInput 115 } 116 117 func (AccountAssignmentState) ElementType() reflect.Type { 118 return reflect.TypeOf((*accountAssignmentState)(nil)).Elem() 119 } 120 121 type accountAssignmentArgs struct { 122 // The Amazon Resource Name (ARN) of the SSO Instance. 123 InstanceArn string `pulumi:"instanceArn"` 124 // The Amazon Resource Name (ARN) of the Permission Set that the admin wants to grant the principal access to. 125 PermissionSetArn string `pulumi:"permissionSetArn"` 126 // An identifier for an object in SSO, such as a user or group. PrincipalIds are GUIDs (For example, `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). 127 PrincipalId string `pulumi:"principalId"` 128 // The entity type for which the assignment will be created. Valid values: `USER`, `GROUP`. 129 PrincipalType string `pulumi:"principalType"` 130 // An AWS account identifier, typically a 10-12 digit string. 131 TargetId string `pulumi:"targetId"` 132 // The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. 133 TargetType *string `pulumi:"targetType"` 134 } 135 136 // The set of arguments for constructing a AccountAssignment resource. 137 type AccountAssignmentArgs struct { 138 // The Amazon Resource Name (ARN) of the SSO Instance. 139 InstanceArn pulumi.StringInput 140 // The Amazon Resource Name (ARN) of the Permission Set that the admin wants to grant the principal access to. 141 PermissionSetArn pulumi.StringInput 142 // An identifier for an object in SSO, such as a user or group. PrincipalIds are GUIDs (For example, `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). 143 PrincipalId pulumi.StringInput 144 // The entity type for which the assignment will be created. Valid values: `USER`, `GROUP`. 145 PrincipalType pulumi.StringInput 146 // An AWS account identifier, typically a 10-12 digit string. 147 TargetId pulumi.StringInput 148 // The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. 149 TargetType pulumi.StringPtrInput 150 } 151 152 func (AccountAssignmentArgs) ElementType() reflect.Type { 153 return reflect.TypeOf((*accountAssignmentArgs)(nil)).Elem() 154 } 155 156 type AccountAssignmentInput interface { 157 pulumi.Input 158 159 ToAccountAssignmentOutput() AccountAssignmentOutput 160 ToAccountAssignmentOutputWithContext(ctx context.Context) AccountAssignmentOutput 161 } 162 163 func (*AccountAssignment) ElementType() reflect.Type { 164 return reflect.TypeOf((**AccountAssignment)(nil)).Elem() 165 } 166 167 func (i *AccountAssignment) ToAccountAssignmentOutput() AccountAssignmentOutput { 168 return i.ToAccountAssignmentOutputWithContext(context.Background()) 169 } 170 171 func (i *AccountAssignment) ToAccountAssignmentOutputWithContext(ctx context.Context) AccountAssignmentOutput { 172 return pulumi.ToOutputWithContext(ctx, i).(AccountAssignmentOutput) 173 } 174 175 // AccountAssignmentArrayInput is an input type that accepts AccountAssignmentArray and AccountAssignmentArrayOutput values. 176 // You can construct a concrete instance of `AccountAssignmentArrayInput` via: 177 // 178 // AccountAssignmentArray{ AccountAssignmentArgs{...} } 179 type AccountAssignmentArrayInput interface { 180 pulumi.Input 181 182 ToAccountAssignmentArrayOutput() AccountAssignmentArrayOutput 183 ToAccountAssignmentArrayOutputWithContext(context.Context) AccountAssignmentArrayOutput 184 } 185 186 type AccountAssignmentArray []AccountAssignmentInput 187 188 func (AccountAssignmentArray) ElementType() reflect.Type { 189 return reflect.TypeOf((*[]*AccountAssignment)(nil)).Elem() 190 } 191 192 func (i AccountAssignmentArray) ToAccountAssignmentArrayOutput() AccountAssignmentArrayOutput { 193 return i.ToAccountAssignmentArrayOutputWithContext(context.Background()) 194 } 195 196 func (i AccountAssignmentArray) ToAccountAssignmentArrayOutputWithContext(ctx context.Context) AccountAssignmentArrayOutput { 197 return pulumi.ToOutputWithContext(ctx, i).(AccountAssignmentArrayOutput) 198 } 199 200 // AccountAssignmentMapInput is an input type that accepts AccountAssignmentMap and AccountAssignmentMapOutput values. 201 // You can construct a concrete instance of `AccountAssignmentMapInput` via: 202 // 203 // AccountAssignmentMap{ "key": AccountAssignmentArgs{...} } 204 type AccountAssignmentMapInput interface { 205 pulumi.Input 206 207 ToAccountAssignmentMapOutput() AccountAssignmentMapOutput 208 ToAccountAssignmentMapOutputWithContext(context.Context) AccountAssignmentMapOutput 209 } 210 211 type AccountAssignmentMap map[string]AccountAssignmentInput 212 213 func (AccountAssignmentMap) ElementType() reflect.Type { 214 return reflect.TypeOf((*map[string]*AccountAssignment)(nil)).Elem() 215 } 216 217 func (i AccountAssignmentMap) ToAccountAssignmentMapOutput() AccountAssignmentMapOutput { 218 return i.ToAccountAssignmentMapOutputWithContext(context.Background()) 219 } 220 221 func (i AccountAssignmentMap) ToAccountAssignmentMapOutputWithContext(ctx context.Context) AccountAssignmentMapOutput { 222 return pulumi.ToOutputWithContext(ctx, i).(AccountAssignmentMapOutput) 223 } 224 225 type AccountAssignmentOutput struct{ *pulumi.OutputState } 226 227 func (AccountAssignmentOutput) ElementType() reflect.Type { 228 return reflect.TypeOf((**AccountAssignment)(nil)).Elem() 229 } 230 231 func (o AccountAssignmentOutput) ToAccountAssignmentOutput() AccountAssignmentOutput { 232 return o 233 } 234 235 func (o AccountAssignmentOutput) ToAccountAssignmentOutputWithContext(ctx context.Context) AccountAssignmentOutput { 236 return o 237 } 238 239 // The Amazon Resource Name (ARN) of the SSO Instance. 240 func (o AccountAssignmentOutput) InstanceArn() pulumi.StringOutput { 241 return o.ApplyT(func(v *AccountAssignment) pulumi.StringOutput { return v.InstanceArn }).(pulumi.StringOutput) 242 } 243 244 // The Amazon Resource Name (ARN) of the Permission Set that the admin wants to grant the principal access to. 245 func (o AccountAssignmentOutput) PermissionSetArn() pulumi.StringOutput { 246 return o.ApplyT(func(v *AccountAssignment) pulumi.StringOutput { return v.PermissionSetArn }).(pulumi.StringOutput) 247 } 248 249 // An identifier for an object in SSO, such as a user or group. PrincipalIds are GUIDs (For example, `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). 250 func (o AccountAssignmentOutput) PrincipalId() pulumi.StringOutput { 251 return o.ApplyT(func(v *AccountAssignment) pulumi.StringOutput { return v.PrincipalId }).(pulumi.StringOutput) 252 } 253 254 // The entity type for which the assignment will be created. Valid values: `USER`, `GROUP`. 255 func (o AccountAssignmentOutput) PrincipalType() pulumi.StringOutput { 256 return o.ApplyT(func(v *AccountAssignment) pulumi.StringOutput { return v.PrincipalType }).(pulumi.StringOutput) 257 } 258 259 // An AWS account identifier, typically a 10-12 digit string. 260 func (o AccountAssignmentOutput) TargetId() pulumi.StringOutput { 261 return o.ApplyT(func(v *AccountAssignment) pulumi.StringOutput { return v.TargetId }).(pulumi.StringOutput) 262 } 263 264 // The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. 265 func (o AccountAssignmentOutput) TargetType() pulumi.StringPtrOutput { 266 return o.ApplyT(func(v *AccountAssignment) pulumi.StringPtrOutput { return v.TargetType }).(pulumi.StringPtrOutput) 267 } 268 269 type AccountAssignmentArrayOutput struct{ *pulumi.OutputState } 270 271 func (AccountAssignmentArrayOutput) ElementType() reflect.Type { 272 return reflect.TypeOf((*[]*AccountAssignment)(nil)).Elem() 273 } 274 275 func (o AccountAssignmentArrayOutput) ToAccountAssignmentArrayOutput() AccountAssignmentArrayOutput { 276 return o 277 } 278 279 func (o AccountAssignmentArrayOutput) ToAccountAssignmentArrayOutputWithContext(ctx context.Context) AccountAssignmentArrayOutput { 280 return o 281 } 282 283 func (o AccountAssignmentArrayOutput) Index(i pulumi.IntInput) AccountAssignmentOutput { 284 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AccountAssignment { 285 return vs[0].([]*AccountAssignment)[vs[1].(int)] 286 }).(AccountAssignmentOutput) 287 } 288 289 type AccountAssignmentMapOutput struct{ *pulumi.OutputState } 290 291 func (AccountAssignmentMapOutput) ElementType() reflect.Type { 292 return reflect.TypeOf((*map[string]*AccountAssignment)(nil)).Elem() 293 } 294 295 func (o AccountAssignmentMapOutput) ToAccountAssignmentMapOutput() AccountAssignmentMapOutput { 296 return o 297 } 298 299 func (o AccountAssignmentMapOutput) ToAccountAssignmentMapOutputWithContext(ctx context.Context) AccountAssignmentMapOutput { 300 return o 301 } 302 303 func (o AccountAssignmentMapOutput) MapIndex(k pulumi.StringInput) AccountAssignmentOutput { 304 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AccountAssignment { 305 return vs[0].(map[string]*AccountAssignment)[vs[1].(string)] 306 }).(AccountAssignmentOutput) 307 } 308 309 func init() { 310 pulumi.RegisterInputType(reflect.TypeOf((*AccountAssignmentInput)(nil)).Elem(), &AccountAssignment{}) 311 pulumi.RegisterInputType(reflect.TypeOf((*AccountAssignmentArrayInput)(nil)).Elem(), AccountAssignmentArray{}) 312 pulumi.RegisterInputType(reflect.TypeOf((*AccountAssignmentMapInput)(nil)).Elem(), AccountAssignmentMap{}) 313 pulumi.RegisterOutputType(AccountAssignmentOutput{}) 314 pulumi.RegisterOutputType(AccountAssignmentArrayOutput{}) 315 pulumi.RegisterOutputType(AccountAssignmentMapOutput{}) 316 }