com.pulumi.mongodbatlas.Organization Maven / Gradle / Ivy
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.mongodbatlas;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.mongodbatlas.OrganizationArgs;
import com.pulumi.mongodbatlas.Utilities;
import com.pulumi.mongodbatlas.inputs.OrganizationState;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* ## # Resource: mongodbatlas.Organization
*
* `mongodbatlas.Organization` provides programmatic management (including creation) of a MongoDB Atlas Organization resource.
*
* > **IMPORTANT NOTE:** When you establish an Atlas organization using this resource, it automatically generates a set of initial public and private Programmatic API Keys. These key values are vital to store because you'll need to use them to grant access to the newly created Atlas organization. To use this resource, `role_names` for new API Key must have the ORG_OWNER role specified.
*
* > **IMPORTANT NOTE:** To use this resource, the requesting API Key must have the Organization Owner role. The requesting API Key's organization must be a paying organization. To learn more, see Configure a Paying Organization in the MongoDB Atlas documentation.
*
* > **NOTE** Import command is currently not supported for this resource.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.mongodbatlas.Organization;
* import com.pulumi.mongodbatlas.OrganizationArgs;
* 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 test = new Organization("test", OrganizationArgs.builder()
* .orgOwnerId("6205e5fffff79cde6f")
* .name("testCreateORG")
* .description("test API key from Org Creation Test")
* .roleNames("ORG_OWNER")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
@ResourceType(type="mongodbatlas:index/organization:Organization")
public class Organization extends com.pulumi.resources.CustomResource {
/**
* Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization.
*
*/
@Export(name="apiAccessListRequired", refs={Boolean.class}, tree="[0]")
private Output apiAccessListRequired;
/**
* @return Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization.
*
*/
public Output apiAccessListRequired() {
return this.apiAccessListRequired;
}
@Export(name="description", refs={String.class}, tree="[0]")
private Output description;
public Output description() {
return this.description;
}
/**
* Unique 24-hexadecimal digit string that identifies the federation to link the newly created organization to. If specified, the proposed Organization Owner of the new organization must have the Organization Owner role in an organization associated with the federation.
*
*/
@Export(name="federationSettingsId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> federationSettingsId;
/**
* @return Unique 24-hexadecimal digit string that identifies the federation to link the newly created organization to. If specified, the proposed Organization Owner of the new organization must have the Organization Owner role in an organization associated with the federation.
*
*/
public Output> federationSettingsId() {
return Codegen.optional(this.federationSettingsId);
}
/**
* Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/.
*
*/
@Export(name="multiFactorAuthRequired", refs={Boolean.class}, tree="[0]")
private Output multiFactorAuthRequired;
/**
* @return Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/.
*
*/
public Output multiFactorAuthRequired() {
return this.multiFactorAuthRequired;
}
/**
* The name of the organization you want to create. (Cannot be changed via this Provider after creation.)
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the organization you want to create. (Cannot be changed via this Provider after creation.)
*
*/
public Output name() {
return this.name;
}
/**
* The organization id.
*
*/
@Export(name="orgId", refs={String.class}, tree="[0]")
private Output orgId;
/**
* @return The organization id.
*
*/
public Output orgId() {
return this.orgId;
}
/**
* Unique 24-hexadecimal digit string that identifies the Atlas user that you want to assign the Organization Owner role. This user must be a member of the same organization as the calling API key. This is only required when authenticating with Programmatic API Keys. [MongoDB Atlas Admin API - Get User By Username](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/MongoDB-Cloud-Users/operation/getUserByUsername)
*
*/
@Export(name="orgOwnerId", refs={String.class}, tree="[0]")
private Output orgOwnerId;
/**
* @return Unique 24-hexadecimal digit string that identifies the Atlas user that you want to assign the Organization Owner role. This user must be a member of the same organization as the calling API key. This is only required when authenticating with Programmatic API Keys. [MongoDB Atlas Admin API - Get User By Username](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/MongoDB-Cloud-Users/operation/getUserByUsername)
*
*/
public Output orgOwnerId() {
return this.orgOwnerId;
}
@Export(name="privateKey", refs={String.class}, tree="[0]")
private Output privateKey;
public Output privateKey() {
return this.privateKey;
}
/**
* Public API key value set for the specified organization API key.
*
*/
@Export(name="publicKey", refs={String.class}, tree="[0]")
private Output publicKey;
/**
* @return Public API key value set for the specified organization API key.
*
*/
public Output publicKey() {
return this.publicKey;
}
/**
* Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/.
*
*/
@Export(name="restrictEmployeeAccess", refs={Boolean.class}, tree="[0]")
private Output restrictEmployeeAccess;
/**
* @return Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/.
*
*/
public Output restrictEmployeeAccess() {
return this.restrictEmployeeAccess;
}
/**
* List of Organization roles that the Programmatic API key needs to have. Ensure that you provide at least one role and ensure all roles are valid for the Organization. You must specify an array even if you are only associating a single role with the Programmatic API key. The [MongoDB Documentation](https://www.mongodb.com/docs/atlas/reference/user-roles/#organization-roles) describes the roles that you can assign to a Programmatic API key.
*
*/
@Export(name="roleNames", refs={List.class,String.class}, tree="[0,1]")
private Output> roleNames;
/**
* @return List of Organization roles that the Programmatic API key needs to have. Ensure that you provide at least one role and ensure all roles are valid for the Organization. You must specify an array even if you are only associating a single role with the Programmatic API key. The [MongoDB Documentation](https://www.mongodb.com/docs/atlas/reference/user-roles/#organization-roles) describes the roles that you can assign to a Programmatic API key.
*
*/
public Output> roleNames() {
return this.roleNames;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Organization(java.lang.String name) {
this(name, OrganizationArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Organization(java.lang.String name, OrganizationArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Organization(java.lang.String name, OrganizationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("mongodbatlas:index/organization:Organization", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Organization(java.lang.String name, Output id, @Nullable OrganizationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("mongodbatlas:index/organization:Organization", name, state, makeResourceOptions(options, id), false);
}
private static OrganizationArgs makeArgs(OrganizationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? OrganizationArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.additionalSecretOutputs(List.of(
"privateKey",
"publicKey"
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Organization get(java.lang.String name, Output id, @Nullable OrganizationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Organization(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy