Skip to content

Instantly share code, notes, and snippets.

View manojahi's full-sized avatar
🎯
Focusing

Manoj Ahirwar manojahi

🎯
Focusing
View GitHub Profile
dynamodb:
token: Token_Dev
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@DynamoDBTable(tableName = "")
@DynamodbTableEnv("dynamodb.token") //it will search for this property in application.yml
public class Token extends DynamoModel {
@Id
@DynamoDBIgnore
public class DynamodbTableNameResolver extends DynamoDBMapperConfig.DefaultTableNameResolver {
private String region;
private String activeProfile;
private Environment environment = null;
public DynamodbTableNameResolver(String region, String activeProfile, Environment environment) {
this.region = region;
this.activeProfile = activeProfile;
this.environment = environment;
}
@Configuration
@EnableDynamoDBRepositories(basePackages = "com.example.repository")
public class DynamoDbConfig {
@Value("${amazon.dynamodb.endpoint}")
private String amazonDynamoDbEndpoint;
@Value("${amazon.aws.access-key}")
private String amazonAwsAccessKey;
@Value("${amazon.aws.secret-key}")
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
public @interface DynamodbTableEnv {
String value() default "";
}
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.2</version>
<dependencies>
<!-- sets the desired version of checkstyle -->
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html
Checkstyle is very configurable. Be sure to read the documentation at
name: Falcon CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
@manojahi
manojahi / my_cron.config
Created January 16, 2022 07:48
Cronjob in elastic beanstalk
files:
/usr/local/bin/my_cron_script.sh:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
export $(cat /opt/elasticbeanstalk/deployment/env | xargs)
source $PYTHONPATH/activate
python3 /var/app/current/manage.py my_process