How to use the cloudform-types.Fn.Equals function in cloudform-types

To help you get started, we’ve selected a few cloudform-types 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 aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public initTemplate(): Template {
        return {
            Parameters: this.makeParams(),
            Resources: {
                [ResourceConstants.RESOURCES.APIKeyLogicalID]: this.makeAppSyncApiKey()
            },
            Outputs: {
                [ResourceConstants.OUTPUTS.GraphQLAPIApiKeyOutput]: this.makeApiKeyOutput()
            },
            Conditions: {
                [ResourceConstants.CONDITIONS.ShouldCreateAPIKey]:
                    Fn.And([
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
                        Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.AuthCognitoUserPoolId), ResourceConstants.NONE)
                    ]),
                [ResourceConstants.CONDITIONS.APIKeyExpirationEpochIsPositive]:
                    Fn.And([
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), 0))
                    ]),
            }
        }
    }
github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public initTemplate(): Template {
        return {
            Parameters: this.makeParams(),
            Resources: {
                [ResourceConstants.RESOURCES.APIKeyLogicalID]: this.makeAppSyncApiKey()
            },
            Outputs: {
                [ResourceConstants.OUTPUTS.GraphQLAPIApiKeyOutput]: this.makeApiKeyOutput()
            },
            Conditions: {
                [ResourceConstants.CONDITIONS.ShouldCreateAPIKey]:
                    Fn.And([
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
                        Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.AuthCognitoUserPoolId), ResourceConstants.NONE)
                    ]),
                [ResourceConstants.CONDITIONS.APIKeyExpirationEpochIsPositive]:
                    Fn.And([
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), 0))
                    ]),
            }
        }
    }
github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public initTemplate(apiKeyConfig: Transformer.ApiKeyConfig): Template {
    return {
      Parameters: this.makeParams(),
      Resources: {
        [ResourceConstants.RESOURCES.APIKeyLogicalID]: this.makeAppSyncApiKey(apiKeyConfig),
      },
      Outputs: {
        [ResourceConstants.OUTPUTS.GraphQLAPIApiKeyOutput]: this.makeApiKeyOutput(),
      },
      Conditions: {
        [ResourceConstants.CONDITIONS.ShouldCreateAPIKey]: Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.CreateAPIKey), 1),
        [ResourceConstants.CONDITIONS.APIKeyExpirationEpochIsPositive]: Fn.And([
          Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
          Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), 0)),
        ]),
      },
    };
  }
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / resources.ts View on Github external
public initTemplate(): Template {
    return {
      Parameters: this.makeParams(),
      Resources: {
        [ResourceConstants.RESOURCES.GraphQLAPILogicalID]: this.makeAppSyncAPI(),
      },
      Outputs: {
        [ResourceConstants.OUTPUTS.GraphQLAPIIdOutput]: this.makeAPIIDOutput(),
        [ResourceConstants.OUTPUTS.GraphQLAPIEndpointOutput]: this.makeAPIEndpointOutput(),
      },
      Conditions: {
        [ResourceConstants.CONDITIONS.ShouldUsePayPerRequestBilling]: Fn.Equals(
          Fn.Ref(ResourceConstants.PARAMETERS.DynamoDBBillingMode),
          'PAY_PER_REQUEST'
        ),

        [ResourceConstants.CONDITIONS.ShouldUsePointInTimeRecovery]: Fn.Equals(
          Fn.Ref(ResourceConstants.PARAMETERS.DynamoDBEnablePointInTimeRecovery),
          'true'
        ),
        [ResourceConstants.CONDITIONS.ShouldUseServerSideEncryption]: Fn.Equals(
          Fn.Ref(ResourceConstants.PARAMETERS.DynamoDBEnableServerSideEncryption),
          'true'
        ),
      },
    };
  }
github aws-amplify / amplify-cli / packages / graphql-appsync-transformer / src / resources.ts View on Github external
public makeEnvironmentConditions() {
        return {
            [ResourceConstants.CONDITIONS.HasEnvironmentParameter]:
                Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.Env), ResourceConstants.NONE))
        }
    }
github aws-amplify / amplify-cli / packages / graphql-transformer-core / src / util / SchemaResourceUtil.ts View on Github external
public makeEnvironmentConditions() {
    return {
      [ResourceConstants.CONDITIONS.HasEnvironmentParameter]: Fn.Not(
        Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.Env), ResourceConstants.NONE)
      ),
    };
  }
github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
Resources: {
                [ResourceConstants.RESOURCES.APIKeyLogicalID]: this.makeAppSyncApiKey()
            },
            Outputs: {
                [ResourceConstants.OUTPUTS.GraphQLAPIApiKeyOutput]: this.makeApiKeyOutput()
            },
            Conditions: {
                [ResourceConstants.CONDITIONS.ShouldCreateAPIKey]:
                    Fn.And([
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
                        Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.AuthCognitoUserPoolId), ResourceConstants.NONE)
                    ]),
                [ResourceConstants.CONDITIONS.APIKeyExpirationEpochIsPositive]:
                    Fn.And([
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
                        Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), 0))
                    ]),
            }
        }
    }
github aws-amplify / amplify-cli / packages / graphql-dynamodb-transformer / src / resources.ts View on Github external
return {
      Parameters: this.makeParams(),
      Resources: {
        [ResourceConstants.RESOURCES.GraphQLAPILogicalID]: this.makeAppSyncAPI(),
      },
      Outputs: {
        [ResourceConstants.OUTPUTS.GraphQLAPIIdOutput]: this.makeAPIIDOutput(),
        [ResourceConstants.OUTPUTS.GraphQLAPIEndpointOutput]: this.makeAPIEndpointOutput(),
      },
      Conditions: {
        [ResourceConstants.CONDITIONS.ShouldUsePayPerRequestBilling]: Fn.Equals(
          Fn.Ref(ResourceConstants.PARAMETERS.DynamoDBBillingMode),
          'PAY_PER_REQUEST'
        ),

        [ResourceConstants.CONDITIONS.ShouldUsePointInTimeRecovery]: Fn.Equals(
          Fn.Ref(ResourceConstants.PARAMETERS.DynamoDBEnablePointInTimeRecovery),
          'true'
        ),
        [ResourceConstants.CONDITIONS.ShouldUseServerSideEncryption]: Fn.Equals(
          Fn.Ref(ResourceConstants.PARAMETERS.DynamoDBEnableServerSideEncryption),
          'true'
        ),
      },
    };
  }
github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public initTemplate(apiKeyConfig: Transformer.ApiKeyConfig): Template {
    return {
      Parameters: this.makeParams(),
      Resources: {
        [ResourceConstants.RESOURCES.APIKeyLogicalID]: this.makeAppSyncApiKey(apiKeyConfig),
      },
      Outputs: {
        [ResourceConstants.OUTPUTS.GraphQLAPIApiKeyOutput]: this.makeApiKeyOutput(),
      },
      Conditions: {
        [ResourceConstants.CONDITIONS.ShouldCreateAPIKey]: Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.CreateAPIKey), 1),
        [ResourceConstants.CONDITIONS.APIKeyExpirationEpochIsPositive]: Fn.And([
          Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
          Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), 0)),
        ]),
      },
    };
  }
github aws-amplify / amplify-cli / packages / graphql-auth-transformer / src / resources.ts View on Github external
public initTemplate(apiKeyConfig: Transformer.ApiKeyConfig): Template {
    return {
      Parameters: this.makeParams(),
      Resources: {
        [ResourceConstants.RESOURCES.APIKeyLogicalID]: this.makeAppSyncApiKey(apiKeyConfig),
      },
      Outputs: {
        [ResourceConstants.OUTPUTS.GraphQLAPIApiKeyOutput]: this.makeApiKeyOutput(),
      },
      Conditions: {
        [ResourceConstants.CONDITIONS.ShouldCreateAPIKey]: Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.CreateAPIKey), 1),
        [ResourceConstants.CONDITIONS.APIKeyExpirationEpochIsPositive]: Fn.And([
          Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), -1)),
          Fn.Not(Fn.Equals(Fn.Ref(ResourceConstants.PARAMETERS.APIKeyExpirationEpoch), 0)),
        ]),
      },
    };
  }