
com.pwrdrvr.microapps.cdk.MicroAppsSvcs Maven / Gradle / Ivy
package com.pwrdrvr.microapps.cdk;
/**
* (experimental) Create a new MicroApps Services construct, including the Deployer and Router Lambda Functions, and the DynamoDB Table used by both.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.75.0 (build 63bb957)", date = "2023-06-14T17:32:47.076Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = com.pwrdrvr.microapps.cdk.$Module.class, fqn = "@pwrdrvr/microapps-cdk.MicroAppsSvcs")
public class MicroAppsSvcs extends software.constructs.Construct implements com.pwrdrvr.microapps.cdk.IMicroAppsSvcs {
protected MicroAppsSvcs(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected MicroAppsSvcs(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public MicroAppsSvcs(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable com.pwrdrvr.microapps.cdk.MicroAppsSvcsProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public MicroAppsSvcs(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* (experimental) Lambda function for the Deployer.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.Function getDeployerFunc() {
return software.amazon.jsii.Kernel.get(this, "deployerFunc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Function.class));
}
/**
* (experimental) DynamoDB table used by Router, Deployer, and Release console app.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.dynamodb.ITable getTable() {
return software.amazon.jsii.Kernel.get(this, "table", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.dynamodb.ITable.class));
}
/**
* (experimental) Lambda function for the Router.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.Function getRouterFunc() {
return software.amazon.jsii.Kernel.get(this, "routerFunc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Function.class));
}
/**
* (experimental) A fluent builder for {@link com.pwrdrvr.microapps.cdk.MicroAppsSvcs}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private com.pwrdrvr.microapps.cdk.MicroAppsSvcsProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* (experimental) Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions.
*
* @return {@code this}
* @param appEnv Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder appEnv(final java.lang.String appEnv) {
this.props().appEnv(appEnv);
return this;
}
/**
* (experimental) S3 bucket for deployed applications.
*
* @return {@code this}
* @param bucketApps S3 bucket for deployed applications. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucketApps(final software.amazon.awscdk.services.s3.IBucket bucketApps) {
this.props().bucketApps(bucketApps);
return this;
}
/**
* (experimental) CloudFront Origin Access Identity for the deployed applications bucket.
*
* @return {@code this}
* @param bucketAppsOai CloudFront Origin Access Identity for the deployed applications bucket. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucketAppsOai(final software.amazon.awscdk.services.cloudfront.OriginAccessIdentity bucketAppsOai) {
this.props().bucketAppsOai(bucketAppsOai);
return this;
}
/**
* (experimental) S3 bucket for staged applications (prior to deploy).
*
* @return {@code this}
* @param bucketAppsStaging S3 bucket for staged applications (prior to deploy). This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucketAppsStaging(final software.amazon.awscdk.services.s3.IBucket bucketAppsStaging) {
this.props().bucketAppsStaging(bucketAppsStaging);
return this;
}
/**
* (experimental) Optional asset name root.
*
* Default: - resource names auto assigned
*
* Example:
*
*
* microapps
*
*
* @return {@code this}
* @param assetNameRoot Optional asset name root. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder assetNameRoot(final java.lang.String assetNameRoot) {
this.props().assetNameRoot(assetNameRoot);
return this;
}
/**
* (experimental) Optional asset name suffix.
*
* Default: none
*
* Example:
*
*
* -dev-pr-12
*
*
* @return {@code this}
* @param assetNameSuffix Optional asset name suffix. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder assetNameSuffix(final java.lang.String assetNameSuffix) {
this.props().assetNameSuffix(assetNameSuffix);
return this;
}
/**
* (experimental) Deployer timeout.
*
* For larger applications this needs to be set up to 2-5 minutes for the S3 copy
*
* Default: 2 minutes
*
* @return {@code this}
* @param deployerTimeout Deployer timeout. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder deployerTimeout(final software.amazon.awscdk.Duration deployerTimeout) {
this.props().deployerTimeout(deployerTimeout);
return this;
}
/**
* (experimental) ARN of the IAM Role for the Edge to Origin Lambda Function.
*
* @return {@code this}
* @param edgeToOriginRoleArn ARN of the IAM Role for the Edge to Origin Lambda Function. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder edgeToOriginRoleArn(final java.util.List edgeToOriginRoleArn) {
this.props().edgeToOriginRoleArn(edgeToOriginRoleArn);
return this;
}
/**
* (experimental) API Gateway v2 HTTP for Router and app.
*
* @return {@code this}
* @param httpApi API Gateway v2 HTTP for Router and app. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder httpApi(final software.amazon.awscdk.services.apigatewayv2.alpha.HttpApi httpApi) {
this.props().httpApi(httpApi);
return this;
}
/**
* (experimental) RemovalPolicy override for child resources.
*
* Note: if set to DESTROY the S3 buckes will have autoDeleteObjects
set to true
*
* Default: - per resource default
*
* @return {@code this}
* @param removalPolicy RemovalPolicy override for child resources. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder removalPolicy(final software.amazon.awscdk.RemovalPolicy removalPolicy) {
this.props().removalPolicy(removalPolicy);
return this;
}
/**
* (experimental) Require IAM auth on API Gateway and Lambda Function URLs.
*
* Default: true
*
* @return {@code this}
* @param requireIamAuthorization Require IAM auth on API Gateway and Lambda Function URLs. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder requireIamAuthorization(final java.lang.Boolean requireIamAuthorization) {
this.props().requireIamAuthorization(requireIamAuthorization);
return this;
}
/**
* (experimental) Path prefix on the root of the deployment.
*
* Default: none
*
* Example:
*
*
* dev/
*
*
* @return {@code this}
* @param rootPathPrefix Path prefix on the root of the deployment. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder rootPathPrefix(final java.lang.String rootPathPrefix) {
this.props().rootPathPrefix(rootPathPrefix);
return this;
}
/**
* (experimental) Applies when using s3StrictBucketPolicy = true.
*
* AROAs of the IAM Role to exclude from the DENY rules on the S3 Bucket Policy.
* This allows sessions that assume the IAM Role to be excluded from the
* DENY rules on the S3 Bucket Policy.
*
* Typically any admin roles / users that need to view or manage the S3 Bucket
* would be added to this list.
*
* Roles / users that are used directly, not assumed, can be added to s3PolicyBypassRoleNames
instead.
*
* Note: This AROA must be specified to prevent this policy from locking
* out non-root sessions that have assumed the admin role.
*
* The notPrincipals will only match the role name exactly and will not match
* any session that has assumed the role since notPrincipals does not allow
* wildcard matches and does not do wildcard matches implicitly either.
*
* The AROA must be used because there are only 3 Principal variables available:
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
* aws:username, aws:userid, aws:PrincipalTag
*
* For an assumed role, aws:username is blank, aws:userid is:
* [unique id AKA AROA for Role]:[session name]
*
* Table of unique ID prefixes such as AROA:
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-prefixes
*
* The name of the role is simply not available for an assumed role and, if it was,
* a complicated comparison would be requierd to prevent exclusion
* of applying the Deny Rule to roles from other accounts.
*
* To get the AROA with the AWS CLI:
* aws iam get-role --role-name ROLE-NAME
* aws iam get-user --user-name USER-NAME
*
* Example:
*
*
* [ 'AROA1234567890123' ]
*
*
* @return {@code this}
* @see s3StrictBucketPolicy
* @param s3PolicyBypassAroAs Applies when using s3StrictBucketPolicy = true. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder s3PolicyBypassAroAs(final java.util.List s3PolicyBypassAroAs) {
this.props().s3PolicyBypassAroAs(s3PolicyBypassAroAs);
return this;
}
/**
* (experimental) Applies when using s3StrictBucketPolicy = true.
*
* IAM Role or IAM User names to exclude from the DENY rules on the S3 Bucket Policy.
*
* Roles that are Assumed must instead have their AROA added to s3PolicyBypassAROAs
.
*
* Typically any admin roles / users that need to view or manage the S3 Bucket
* would be added to this list.
*
* Example:
*
*
* ['arn:aws:iam::1234567890123:role/AdminAccess', 'arn:aws:iam::1234567890123:user/MyAdminUser']
*
*
* @return {@code this}
* @see s3PolicyBypassAROAs
* @param s3PolicyBypassPrincipalArNs Applies when using s3StrictBucketPolicy = true. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder s3PolicyBypassPrincipalArNs(final java.util.List s3PolicyBypassPrincipalArNs) {
this.props().s3PolicyBypassPrincipalArNs(s3PolicyBypassPrincipalArNs);
return this;
}
/**
* (experimental) Use a strict S3 Bucket Policy that prevents applications from reading/writing/modifying/deleting files in the S3 Bucket outside of the path that is specific to their app/version.
*
* This setting should be used when applications are less than
* fully trusted.
*
* Default: false
*
* @return {@code this}
* @param s3StrictBucketPolicy Use a strict S3 Bucket Policy that prevents applications from reading/writing/modifying/deleting files in the S3 Bucket outside of the path that is specific to their app/version. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder s3StrictBucketPolicy(final java.lang.Boolean s3StrictBucketPolicy) {
this.props().s3StrictBucketPolicy(s3StrictBucketPolicy);
return this;
}
/**
* (experimental) Existing table for apps/versions/rules.
*
* Default: created by construct
*
* @return {@code this}
* @param table Existing table for apps/versions/rules. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder table(final software.amazon.awscdk.services.dynamodb.ITable table) {
this.props().table(table);
return this;
}
/**
* @returns a newly built instance of {@link com.pwrdrvr.microapps.cdk.MicroAppsSvcs}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public com.pwrdrvr.microapps.cdk.MicroAppsSvcs build() {
return new com.pwrdrvr.microapps.cdk.MicroAppsSvcs(
this.scope,
this.id,
this.props != null ? this.props.build() : null
);
}
private com.pwrdrvr.microapps.cdk.MicroAppsSvcsProps.Builder props() {
if (this.props == null) {
this.props = new com.pwrdrvr.microapps.cdk.MicroAppsSvcsProps.Builder();
}
return this.props;
}
}
}