Skip to content

Instantly share code, notes, and snippets.

View begmaroman's full-sized avatar
💭
I may be slow to respond.

Roman Behma begmaroman

💭
I may be slow to respond.
View GitHub Profile
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
// Lottery implements simple lottery contract.
// In this contract, the enter function allows players to enter the lottery
// by sending a positive value to the contract, which is added to the jackpot total.
// The random function generates a random index within the bounds of the players
// array length, using the current block timestamp, difficulty, and array length.
//
// The pickWinner function selects the winner by calling the random function and
@begmaroman
begmaroman / acme-dns-route53-cloudwatch.tf
Created May 8, 2019 18:23
Terraform code of CloudWatch trigger of acme-dns-route53
# Cloudwatch event rule that runs acme-dns-route53 lambda every 12 hours
resource "aws_cloudwatch_event_rule" "acme_dns_route53_sheduler" {
name = "acme-dns-route53-issuer-scheduler"
schedule_expression = "cron(0 */12 * * ? *)"
}
# Specify the lambda function to run
resource "aws_cloudwatch_event_target" "acme_dns_route53_sheduler_target" {
rule = "${aws_cloudwatch_event_rule.acme_dns_route53_sheduler.name}"
arn = "${aws_lambda_function.acme_dns_route53.arn}"
@begmaroman
begmaroman / lambda-acme-dns-route53-executor-policy.json
Last active May 14, 2019 18:16
AWS Policy for acme-dns-route53
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup"
],
"Resource": "arn:aws:logs:<AWS_REGION>:<AWS_ACCOUNT_ID>:*"
},