Constant Field Values

com.cloudforge.*

com.cloudforgeci.*

  • com.cloudforgeci.api.core.customresource.AssetFreeCustomResource
    Modifier and Type
    Constant Field
    Value
    public static final String
    "CloudForgeAssetFreeCustomResource"
    public static final String
    "const https = require(\'https\');\n\nfunction respond(event, status, reason, data) {\n return new Promise((resolve, reject) => {\n const body = JSON.stringify({\n Status: status,\n Reason: reason || \'See the function\\\'s own CloudWatch Logs group for details.\',\n PhysicalResourceId: event.PhysicalResourceId || event.LogicalResourceId,\n StackId: event.StackId,\n RequestId: event.RequestId,\n LogicalResourceId: event.LogicalResourceId,\n Data: data || {}\n });\n const url = new URL(event.ResponseURL);\n const req = https.request({\n hostname: url.hostname,\n port: url.port || 443,\n path: url.pathname + url.search,\n method: \'PUT\',\n headers: { \'content-type\': \'\', \'content-length\': Buffer.byteLength(body) },\n timeout: 10000\n }, (res) => {\n res.on(\'data\', () => {});\n res.on(\'error\', reject);\n res.on(\'end\', () => {\n if (res.statusCode >= 200 && res.statusCode < 300) {\n resolve();\n } else {\n reject(new Error(\'ResponseURL PUT failed with HTTP status \' + res.statusCode));\n }\n });\n });\n req.on(\'timeout\', () => req.destroy(new Error(\'ResponseURL PUT timed out\')));\n req.on(\'error\', reject);\n req.write(body);\n req.end();\n });\n}\n"
    public static final String
    "const { SSMClient, PutParameterCommand } = require(\'@aws-sdk/client-ssm\');\n\nexports.handler = async (event) => {\n try {\n if (event.RequestType !== \'Delete\') {\n const p = event.ResourceProperties;\n const endpoint = process.env.AWS_ENDPOINT_URL;\n const client = new SSMClient({\n region: p.Region,\n ...(endpoint ? { endpoint } : {})\n });\n await client.send(new PutParameterCommand({\n Name: p.ParameterName,\n Value: p.ParameterValue,\n Type: \'String\',\n Description: p.ParameterDescription,\n Overwrite: true\n }));\n }\n await respond(event, \'SUCCESS\');\n } catch (err) {\n console.error(\'SSM parameter writer failed: \' + err);\n try {\n await respond(event, \'FAILED\', String(err));\n } catch (deliveryErr) {\n console.error(\'Could not deliver FAILED response to CloudFormation: \' + deliveryErr);\n }\n }\n};\n"