FormType class

Resource for managing an AWS DataZone Form Type.

Example Usage

Basic Usage

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

const domainExecutionRole = new aws.iam.Role("domain_execution_role", {
    inlinePolicies: [{
        name: "example-policy",
        policy: JSON.stringify({
            Version: "2012-10-17",
            Statement: [{
                Action: [
                    "datazone:*",
                    "ram:*",
                    "sso:*",
                    "kms:*",
                ],
                Effect: "Allow",
                Resource: "*",
            }],
        }),
    }],
    name: "example-role",
    assumeRolePolicy: JSON.stringify({
        Version: "2012-10-17",
        Statement: [
            {
                Action: [
                    "sts:AssumeRole",
                    "sts:TagSession",
                ],
                Effect: "Allow",
                Principal: {
                    Service: "datazone.amazonaws.com",
                },
            },
            {
                Action: [
                    "sts:AssumeRole",
                    "sts:TagSession",
                ],
                Effect: "Allow",
                Principal: {
                    Service: "cloudformation.amazonaws.com",
                },
            },
        ],
    }),
});
const test = new aws.datazone.Domain("test", {
    name: "example",
    domainExecutionRole: domainExecutionRole.arn,
});
const testSecurityGroup = new aws.ec2.SecurityGroup("test", {name: "example"});
const testProject = new aws.datazone.Project("test", {
    domainIdentifier: test.id,
    glossaryTerms: ["2N8w6XJCwZf"],
    name: "example name",
    description: "desc",
    skipDeletionCheck: true,
});
const testFormType = new aws.datazone.FormType("test", {
    model: {
        smithy: `\\tstructure SageMakerModelFormType {
\\t\\t\\t@required
\\t\\t\\t@amazon.datazone#searchable
\\t\\t\\tmodelName: String

\\t\\t\\t@required
\\t\\t\\tmodelArn: String

\\t\\t\\t@required
\\t\\t\\tcreationTime: String
\\t\\t\\t}
`,
    },
    description: "desc",
    name: "SageMakerModelFormType",
    domainIdentifier: test.id,
    owningProjectIdentifier: testProject.id,
    status: "DISABLED",
});
import pulumi
import json
import pulumi_aws as aws

domain_execution_role = aws.iam.Role("domain_execution_role",
    inline_policies=[{
        "name": "example-policy",
        "policy": json.dumps({
            "Version": "2012-10-17",
            "Statement": [{
                "Action": [
                    "datazone:*",
                    "ram:*",
                    "sso:*",
                    "kms:*",
                ],
                "Effect": "Allow",
                "Resource": "*",
            }],
        }),
    }],
    name="example-role",
    assume_role_policy=json.dumps({
        "Version": "2012-10-17",
        "Statement": [
            {
                "Action": [
                    "sts:AssumeRole",
                    "sts:TagSession",
                ],
                "Effect": "Allow",
                "Principal": {
                    "Service": "datazone.amazonaws.com",
                },
            },
            {
                "Action": [
                    "sts:AssumeRole",
                    "sts:TagSession",
                ],
                "Effect": "Allow",
                "Principal": {
                    "Service": "cloudformation.amazonaws.com",
                },
            },
        ],
    }))
test = aws.datazone.Domain("test",
    name="example",
    domain_execution_role=domain_execution_role.arn)
test_security_group = aws.ec2.SecurityGroup("test", name="example")
test_project = aws.datazone.Project("test",
    domain_identifier=test.id,
    glossary_terms=["2N8w6XJCwZf"],
    name="example name",
    description="desc",
    skip_deletion_check=True)
test_form_type = aws.datazone.FormType("test",
    model={
        "smithy": """\tstructure SageMakerModelFormType {
\t\t\t@required
\t\t\t@amazon.datazone#searchable
\t\t\tmodelName: String

\t\t\t@required
\t\t\tmodelArn: String

\t\t\t@required
\t\t\tcreationTime: String
\t\t\t}
""",
    },
    description="desc",
    name="SageMakerModelFormType",
    domain_identifier=test.id,
    owning_project_identifier=test_project.id,
    status="DISABLED")
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var domainExecutionRole = new Aws.Iam.Role("domain_execution_role", new()
    {
        InlinePolicies = new[]
        {
            new Aws.Iam.Inputs.RoleInlinePolicyArgs
            {
                Name = "example-policy",
                Policy = JsonSerializer.Serialize(new Dictionary<string, object?>
                {
                    ["Version"] = "2012-10-17",
                    ["Statement"] = new[]
                    {
                        new Dictionary<string, object?>
                        {
                            ["Action"] = new[]
                            {
                                "datazone:*",
                                "ram:*",
                                "sso:*",
                                "kms:*",
                            },
                            ["Effect"] = "Allow",
                            ["Resource"] = "*",
                        },
                    },
                }),
            },
        },
        Name = "example-role",
        AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Version"] = "2012-10-17",
            ["Statement"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Action"] = new[]
                    {
                        "sts:AssumeRole",
                        "sts:TagSession",
                    },
                    ["Effect"] = "Allow",
                    ["Principal"] = new Dictionary<string, object?>
                    {
                        ["Service"] = "datazone.amazonaws.com",
                    },
                },
                new Dictionary<string, object?>
                {
                    ["Action"] = new[]
                    {
                        "sts:AssumeRole",
                        "sts:TagSession",
                    },
                    ["Effect"] = "Allow",
                    ["Principal"] = new Dictionary<string, object?>
                    {
                        ["Service"] = "cloudformation.amazonaws.com",
                    },
                },
            },
        }),
    });

    var test = new Aws.DataZone.Domain("test", new()
    {
        Name = "example",
        DomainExecutionRole = domainExecutionRole.Arn,
    });

    var testSecurityGroup = new Aws.Ec2.SecurityGroup("test", new()
    {
        Name = "example",
    });

    var testProject = new Aws.DataZone.Project("test", new()
    {
        DomainIdentifier = test.Id,
        GlossaryTerms = new[]
        {
            "2N8w6XJCwZf",
        },
        Name = "example name",
        Description = "desc",
        SkipDeletionCheck = true,
    });

    var testFormType = new Aws.DataZone.FormType("test", new()
    {
        Model = new Aws.DataZone.Inputs.FormTypeModelArgs
        {
            Smithy = @"\tstructure SageMakerModelFormType {
\t\t\t@required
\t\t\t@amazon.datazone#searchable
\t\t\tmodelName: String

\t\t\t@required
\t\t\tmodelArn: String

\t\t\t@required
\t\t\tcreationTime: String
\t\t\t}
",
        },
        Description = "desc",
        Name = "SageMakerModelFormType",
        DomainIdentifier = test.Id,
        OwningProjectIdentifier = testProject.Id,
        Status = "DISABLED",
    });

});
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/datazone"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Version": "2012-10-17",
			"Statement": []map[string]interface{}{
				map[string]interface{}{
					"Action": []string{
						"datazone:*",
						"ram:*",
						"sso:*",
						"kms:*",
					},
					"Effect":   "Allow",
					"Resource": "*",
				},
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		tmpJSON1, err := json.Marshal(map[string]interface{}{
			"Version": "2012-10-17",
			"Statement": []map[string]interface{}{
				map[string]interface{}{
					"Action": []string{
						"sts:AssumeRole",
						"sts:TagSession",
					},
					"Effect": "Allow",
					"Principal": map[string]string{
						"Service": "datazone.amazonaws.com",
					},
				},
				map[string]interface{}{
					"Action": []string{
						"sts:AssumeRole",
						"sts:TagSession",
					},
					"Effect": "Allow",
					"Principal": map[string]string{
						"Service": "cloudformation.amazonaws.com",
					},
				},
			},
		})
		if err != nil {
			return err
		}
		json1 := string(tmpJSON1)
		domainExecutionRole, err := iam.NewRole(ctx, "domain_execution_role", &iam.RoleArgs{
			InlinePolicies: iam.RoleInlinePolicyArray{
				&iam.RoleInlinePolicyArgs{
					Name:   pulumi.String("example-policy"),
					Policy: pulumi.String(json0),
				},
			},
			Name:             pulumi.String("example-role"),
			AssumeRolePolicy: pulumi.String(json1),
		})
		if err != nil {
			return err
		}
		test, err := datazone.NewDomain(ctx, "test", &datazone.DomainArgs{
			Name:                pulumi.String("example"),
			DomainExecutionRole: domainExecutionRole.Arn,
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewSecurityGroup(ctx, "test", &ec2.SecurityGroupArgs{
			Name: pulumi.String("example"),
		})
		if err != nil {
			return err
		}
		testProject, err := datazone.NewProject(ctx, "test", &datazone.ProjectArgs{
			DomainIdentifier: test.ID().ToIDOutput().ToStringOutput(),
			GlossaryTerms: pulumi.StringArray{
				pulumi.String("2N8w6XJCwZf"),
			},
			Name:              pulumi.String("example name"),
			Description:       pulumi.String("desc"),
			SkipDeletionCheck: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = datazone.NewFormType(ctx, "test", &datazone.FormTypeArgs{
			Model: &datazone.FormTypeModelArgs{
				Smithy: pulumi.String(`\tstructure SageMakerModelFormType {
\t\t\t@required
\t\t\t@amazon.datazone#searchable
\t\t\tmodelName: String

\t\t\t@required
\t\t\tmodelArn: String

\t\t\t@required
\t\t\tcreationTime: String
\t\t\t}
`),
			},
			Description:             pulumi.String("desc"),
			Name:                    pulumi.String("SageMakerModelFormType"),
			DomainIdentifier:        test.ID().ToIDOutput().ToStringOutput(),
			OwningProjectIdentifier: testProject.ID().ToIDOutput().ToStringOutput(),
			Status:                  pulumi.String("DISABLED"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_iam_role" "domain_execution_role" {
  inline_policies {
    name = "example-policy"
    policy = jsonencode({
      "Version" = "2012-10-17"
      "Statement" = [{
        "Action"   = ["datazone:*", "ram:*", "sso:*", "kms:*"]
        "Effect"   = "Allow"
        "Resource" = "*"
      }]
    })
  }
  name = "example-role"
  assume_role_policy = jsonencode({
    "Version" = "2012-10-17"
    "Statement" = [{
      "Action" = ["sts:AssumeRole", "sts:TagSession"]
      "Effect" = "Allow"
      "Principal" = {
        "Service" = "datazone.amazonaws.com"
      }
      }, {
      "Action" = ["sts:AssumeRole", "sts:TagSession"]
      "Effect" = "Allow"
      "Principal" = {
        "Service" = "cloudformation.amazonaws.com"
      }
    }]
  })
}
resource "aws_datazone_domain" "test" {
  name                  = "example"
  domain_execution_role = aws_iam_role.domain_execution_role.arn
}
resource "aws_ec2_securitygroup" "test" {
  name = "example"
}
resource "aws_datazone_project" "test" {
  domain_identifier   = aws_datazone_domain.test.id
  glossary_terms      = ["2N8w6XJCwZf"]
  name                = "example name"
  description         = "desc"
  skip_deletion_check = true
}
resource "aws_datazone_formtype" "test" {
  model = {
    smithy = "\\tstructure SageMakerModelFormType {\n\\t\\t\\t@required\n\\t\\t\\t@amazon.datazone#searchable\n\\t\\t\\tmodelName: String\n\n\\t\\t\\t@required\n\\t\\t\\tmodelArn: String\n\n\\t\\t\\t@required\n\\t\\t\\tcreationTime: String\n\\t\\t\\t}\n"
  }
  description               = "desc"
  name                      = "SageMakerModelFormType"
  domain_identifier         = aws_datazone_domain.test.id
  owning_project_identifier = aws_datazone_project.test.id
  status                    = "DISABLED"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.inputs.RoleInlinePolicyArgs;
import com.pulumi.aws.datazone.Domain;
import com.pulumi.aws.datazone.DomainArgs;
import com.pulumi.aws.ec2.SecurityGroup;
import com.pulumi.aws.ec2.SecurityGroupArgs;
import com.pulumi.aws.datazone.Project;
import com.pulumi.aws.datazone.ProjectArgs;
import com.pulumi.aws.datazone.FormType;
import com.pulumi.aws.datazone.FormTypeArgs;
import com.pulumi.aws.datazone.inputs.FormTypeModelArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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 domainExecutionRole = new Role("domainExecutionRole", RoleArgs.builder()
            .inlinePolicies(RoleInlinePolicyArgs.builder()
                .name("example-policy")
                .policy(serializeJson(
                    jsonObject(
                        jsonProperty("Version", "2012-10-17"),
                        jsonProperty("Statement", jsonArray(jsonObject(
                            jsonProperty("Action", jsonArray(
                                "datazone:*",
                                "ram:*",
                                "sso:*",
                                "kms:*"
                            )),
                            jsonProperty("Effect", "Allow"),
                            jsonProperty("Resource", "*")
                        )))
                    )))
                .build())
            .name("example-role")
            .assumeRolePolicy(serializeJson(
                jsonObject(
                    jsonProperty("Version", "2012-10-17"),
                    jsonProperty("Statement", jsonArray(
                        jsonObject(
                            jsonProperty("Action", jsonArray(
                                "sts:AssumeRole",
                                "sts:TagSession"
                            )),
                            jsonProperty("Effect", "Allow"),
                            jsonProperty("Principal", jsonObject(
                                jsonProperty("Service", "datazone.amazonaws.com")
                            ))
                        ),
                        jsonObject(
                            jsonProperty("Action", jsonArray(
                                "sts:AssumeRole",
                                "sts:TagSession"
                            )),
                            jsonProperty("Effect", "Allow"),
                            jsonProperty("Principal", jsonObject(
                                jsonProperty("Service", "cloudformation.amazonaws.com")
                            ))
                        )
                    ))
                )))
            .build());

        var test = new Domain("test", DomainArgs.builder()
            .name("example")
            .domainExecutionRole(domainExecutionRole.arn())
            .build());

        var testSecurityGroup = new SecurityGroup("testSecurityGroup", SecurityGroupArgs.builder()
            .name("example")
            .build());

        var testProject = new Project("testProject", ProjectArgs.builder()
            .domainIdentifier(test.id())
            .glossaryTerms("2N8w6XJCwZf")
            .name("example name")
            .description("desc")
            .skipDeletionCheck(true)
            .build());

        var testFormType = new FormType("testFormType", FormTypeArgs.builder()
            .model(FormTypeModelArgs.builder()
                .smithy("""
\tstructure SageMakerModelFormType {
\t\t\t@required
\t\t\t@amazon.datazone#searchable
\t\t\tmodelName: String

\t\t\t@required
\t\t\tmodelArn: String

\t\t\t@required
\t\t\tcreationTime: String
\t\t\t}
                """)
                .build())
            .description("desc")
            .name("SageMakerModelFormType")
            .domainIdentifier(test.id())
            .owningProjectIdentifier(testProject.id())
            .status("DISABLED")
            .build());

    }
}
resources:
  domainExecutionRole:
    type: aws:iam:Role
    name: domain_execution_role
    properties:
      inlinePolicies:
        - name: example-policy
          policy:
            fn::toJSON:
              Version: 2012-10-17
              Statement:
                - Action:
                    - datazone:*
                    - ram:*
                    - sso:*
                    - kms:*
                  Effect: Allow
                  Resource: '*'
      name: example-role
      assumeRolePolicy:
        fn::toJSON:
          Version: 2012-10-17
          Statement:
            - Action:
                - sts:AssumeRole
                - sts:TagSession
              Effect: Allow
              Principal:
                Service: datazone.amazonaws.com
            - Action:
                - sts:AssumeRole
                - sts:TagSession
              Effect: Allow
              Principal:
                Service: cloudformation.amazonaws.com
  test:
    type: aws:datazone:Domain
    properties:
      name: example
      domainExecutionRole: ${domainExecutionRole.arn}
  testSecurityGroup:
    type: aws:ec2:SecurityGroup
    name: test
    properties:
      name: example
  testProject:
    type: aws:datazone:Project
    name: test
    properties:
      domainIdentifier: ${test.id}
      glossaryTerms:
        - 2N8w6XJCwZf
      name: example name
      description: desc
      skipDeletionCheck: true
  testFormType:
    type: aws:datazone:FormType
    name: test
    properties:
      model:
        smithy: |
          \tstructure SageMakerModelFormType {
          \t\t\t@required
          \t\t\t@amazon.datazone#searchable
          \t\t\tmodelName: String

          \t\t\t@required
          \t\t\tmodelArn: String

          \t\t\t@required
          \t\t\tcreationTime: String
          \t\t\t}
      description: desc
      name: SageMakerModelFormType
      domainIdentifier: ${test.id}
      owningProjectIdentifier: ${testProject.id}
      status: DISABLED

Import

Identity Schema

Required

  • domainIdentifier - (String) Identifier of the DataZone domain.
  • name - (String) Name of the form type.
  • revision - (String) Revision of the form type.

Optional

  • accountId (String) AWS Account where this resource is managed.
  • region (String) Region where this resource is managed.

Using pulumi import, import DataZone Form Type using a comma separated value of domainIdentifier,name,revision. For example:

$ pulumi import aws:datazone/formType:FormType example domain_identifier,name,revision

Constructors

FormType(String name, {FormTypeArgs? args, CustomResourceOptions? options})
Creates a new FormType. name The Pulumi resource name. args Arguments used to configure this FormType. The set of arguments for FormType. options Resource options controlling this resource's behavior.
FormType.reference(String urn)
Creates a typed reference to an existing FormType resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createdAt ↔ Output<String>
Creation time of the Form Type.
latefinal
createdBy ↔ Output<String>
Creator of the Form Type.
latefinal
description ↔ Output<String?>
Description of form type. Must have a length of between 1 and 2048 characters.
latefinal
domainIdentifier ↔ Output<String>
Identifier of the domain.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
imports ↔ Output<List<FormTypeImport>>
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
model ↔ Output<FormTypeModel>
Object of the model of the form type that contains the following attributes.
latefinal
name ↔ Output<String>
Name of the form type. Must be the name of the structure in smithy document.
latefinal
originDomainId ↔ Output<String>
Origin domain id of the Form Type.
latefinal
originProjectId ↔ Output<String>
Origin project id of the Form Type.
latefinal
owningProjectIdentifier ↔ Output<String>
Identifier of project that owns the form type. Must follow regex of ^a-zA-Z0-9_-{1,36}.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
revision ↔ Output<String>
Revision of the Form Type.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status ↔ Output<String>
Status of form type. Must be "ENABLED" or "DISABLED" If status is set to "ENABLED" terraform cannot delete the resource until it is manually changed in the AWS console.
latefinal
timeouts ↔ Output<FormTypeTimeouts?>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {FormTypeState? state, CustomResourceOptions? options}) → FormType
Gets an existing FormType resource's state with the given name and id.