IAM · Identity

IAMUser

Manage IAM users, tags, groups, and policy attachments.

Generic driverUniform lifecycle
Scope
Global
Spec fields
6
Outputs
3
Lookup
Supported

Resource definition

What this resource looks like

This is the CUE shape a Praxis template uses to declare a IAMUser. The resource key is local to the template; metadata.name supplies its stable Praxis identity.

CUE example
resources: {
  ciUser: {
  	apiVersion: "praxis.io/alpha"
  	kind:       "IAMUser"
  	metadata: name: "\(_naming.prefix)-ci"
  	spec: {
  		path: "/ci/"
  		groups: ["${resources.opsGroup.outputs.groupName}"]
  		managedPolicyArns: [
  			"${resources.appPolicy.outputs.arn}",
  		]
  		tags: #AppTags & {purpose: "ci-cd"}
  	}
  }
}

Excerpted from examples/stacks/end-to-end.cue. Open the complete example for its variables and related resources.

Complete examples in the repository

Desired state

Configuration

The spec block accepts 6 fields. 2 are required by the schema; fields with defaults can be omitted.

pathOptional

Path.

string | *"/"
EnumDefault "/"
permissionsBoundaryOptional

Permissions Boundary.

string
String
inlinePoliciesRequired

Inline Policies.

[string]: string
Map
managedPolicyArnsOptional

Managed Policy Arns.

[...string] | *[]
ListDefault []
groupsOptional

Groups.

[...string] | *[]
ListDefault []
tagsRequired

Tags.

[string]: string
Map

Observed values

Outputs

Praxis records these values after observation. A dependent resource can read one with ${resources.<name>.outputs.<field>}.

arnString
userIdString
userNameString

Read without ownership

Data-source lookup

A data block reads an existing IAMUser and exposes its outputs without storing lifecycle state. The generic filter surface accepts id, name, and tag; supported combinations depend on the AWS identity used by this resource.

CUE data source
data: existing: {
  kind: "IAMUser"
  filter: {
    name: "replace-with-provider-name"
  }
}

Understand data sources and filters →

Adopt existing infrastructure

Import

Import persists Praxis state for an existing AWS resource. For this kind, supply: Provider identifier for the existing IAMUser. The example starts in observed mode so Praxis reports drift without correcting it.

CLI
praxis import IAMUser \
  --id <provider-identifier> \
  --account production \
  --observe

Choose managed or observed ownership →

Canonical contract

Complete CUE schema

The field guide above is derived from this definition. The schema remains the source of truth for accepted values, defaults, validation constraints, and outputs in the current alpha revision.

Show the complete schema
schemas/aws/iam/user.cue
package iam

#IAMUser: {
	apiVersion: "praxis.io/alpha"
	kind:       "IAMUser"

	metadata: {
		name: string & =~"^[a-zA-Z0-9+=,.@_-]{1,64}$"
		labels: [string]: string
	}

	spec: {
		path:                 string | *"/"
		permissionsBoundary?: string
		inlinePolicies: [string]: string
		managedPolicyArns: [...string] | *[]
		groups: [...string] | *[]
		tags: [string]: string
	}

	outputs?: {
		arn:      string
		userId:   string
		userName: string
	}
}

View this schema on GitHub →