How to use the @pulumi/pulumi.RunError function in @pulumi/pulumi

To help you get started, we’ve selected a few @pulumi/pulumi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / pulumi-aws / sdk / nodejs / lambda / zMixins.ts View on Github external
public constructor(name: string, args: CallbackFunctionArgs, opts: pulumi.CustomResourceOptions = {}) {
        if (!name) {
            throw new Error("Missing required resource name");
        }

        if (args.callback && args.callbackFactory) {
            throw new pulumi.RunError("Cannot provide both [callback] and [callbackFactory]");
        }

        const func = args.callback || args.callbackFactory;
        if (!func) {
            throw new Error("One of [callback] or [callbackFactory] must be provided.");
        }

        let role: iam.Role;
        if (args.role) {
            role = args.role;
        } else {
            // Attach a role and then, if there are policies, attach those too.
            role = new iam.Role(name, {
                assumeRolePolicy: JSON.stringify(lambdaRolePolicy),
            }, opts);
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / cloudwatch / logGroup.ts View on Github external
function onEvent(name: string, logGroup: cloudwatch.LogGroup, handler: LogGroupEventHandler, args?: LogGroupEventSubscriptionArgs, opts?: pulumi.ResourceOptions): LogGroupEventSubscription {
    throw new RunError("NYI");
}
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / dynamodb / table.ts View on Github external
constructor(
        name: string, table: dynamodb.Table, func: lambda.Function,
        args: TableEventSubscriptionArgs, opts?: pulumi.ResourceOptions) {

        super("aws-serverless:dynamodb:TableEventSubscription", name, func, { table: table }, opts);
        throw new RunError("NYI");
    }
}
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / kinesis / stream.ts View on Github external
function onEvent(name: string, stream: kinesis.Stream, handler: StreamEventHandler,
                 args: StreamEventSubscriptionArgs, opts?: pulumi.ResourceOptions): StreamEventSubscription {
    throw new RunError("NYI");
}
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / cognito / userPool.ts View on Github external
function createLambda(handler: Handler | undefined): pulumi.Output | undefined {
    if (!handler) {
        return undefined;
    }

    throw new RunError("NYI");
}
github pulumi / pulumi-eks / nodejs / eks / nodegroup.ts View on Github external
constructor(name: string, args: NodeGroupOptions, opts?: pulumi.ComponentResourceOptions) {
        super("eks:index:NodeGroup", name, args, opts);

        const k8sProvider = this.getProvider("kubernetes:core:v1/ConfigMap");
        if (k8sProvider === undefined) {
            throw new pulumi.RunError("a 'kubernetes' provider must be specified for a 'NodeGroup'");
        }
        const group = createNodeGroup(name, args, this, k8sProvider);
        this.nodeSecurityGroup = group.nodeSecurityGroup;
        this.cfnStack = group.cfnStack;
        this.registerOutputs(undefined);
    }
}
github pulumi / pulumi-eks / nodejs / eks / nodegroup.ts View on Github external
const cfnStackDeps: Array = [];

    const core = isCoreData(args.cluster) ? args.cluster : args.cluster.core;
    const eksCluster = core.cluster;
    if (core.vpcCni !== undefined) {
        cfnStackDeps.push(core.vpcCni);
    }
    if (core.eksNodeAccess !== undefined) {
        cfnStackDeps.push(core.eksNodeAccess);
    }

    let eksClusterIngressRule: aws.ec2.SecurityGroupRule = args.clusterIngressRule!;
    if (args.nodeSecurityGroup) {
        nodeSecurityGroup = args.nodeSecurityGroup;
        if (eksClusterIngressRule === undefined) {
            throw new pulumi.RunError(`invalid args for node group ${name}, eksClusterIngressRule is required when nodeSecurityGroup is manually speicified`);
        }
    } else {
        nodeSecurityGroup = createNodeGroupSecurityGroup(name, {
            vpcId: core.vpcId,
            clusterSecurityGroup: core.clusterSecurityGroup,
            eksCluster: eksCluster,
        }, parent);
        eksClusterIngressRule = new aws.ec2.SecurityGroupRule(`${name}-eksClusterIngressRule`, {
            description: "Allow pods to communicate with the cluster API Server",
            type: "ingress",
            fromPort: 443,
            toPort: 443,
            protocol: "tcp",
            securityGroupId: core.clusterSecurityGroup.id,
            sourceSecurityGroupId: nodeSecurityGroup.id,
        }, { parent: parent });
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / kinesis / stream.ts View on Github external
constructor(
        name: string, stream: kinesis.Stream, func: lambda.Function,
        args: StreamEventSubscriptionArgs, opts?: pulumi.ResourceOptions) {

        super("aws-serverless:kinesis:StreamEventSubscription", name, func, { stream: stream }, opts);
        throw new RunError("NYI");
    }
}
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / cloudfront / distribution.ts View on Github external
function createLambdaAndGetArn(handler: Handler): pulumi.Output {
    throw new RunError("NYI");
}
github pulumi / pulumi-aws-serverless / nodejs / aws-serverless / cloudwatch / logGroup.ts View on Github external
constructor(
        name: string, logGroup: cloudwatch.LogGroup, func: lambda.Function,
        args: LogGroupEventSubscriptionArgs, opts?: pulumi.ResourceOptions) {

        super("aws-serverless:cloudwatch:LogGroupEventSubscription", name, func, { logGroup: logGroup }, opts);
        throw new RunError("NYI");
    }
}