Skip to main content

3 posts tagged with "Oracle Cloud Infrastructure"

View All Tags

OCI Email Delivery vs. AWS SES Deep Dive on OCI Email Setup

· 4 min read

Oracle Cloud Infrastructure (OCI) Email Delivery is an email sending service and SMTP relay that provides a fast, reliable managed solution for sending both bulk and transactional emails. It is an excellent choice for applications requiring email communications such as:

  • Receipts and invoices
  • Fraud detection alerts
  • Multi-factor authentication codes
  • Password reset emails

If you're currently using Amazon SES or SendGrid, OCI Email Delivery provides similar capabilities with cost-effective pricing and scalability.

Prerequisites

To use OCI Email Delivery, ensure you have:

  1. An OCI account - If you don't have one, sign up for a free trial with $300 in credits.
  2. Proper permissions - Your user should be assigned to a group with email-family management permissions.
  3. A DNS domain - Required to publish DKIM and SPF records for better email authentication.

Setting Up OCI Email Delivery

1. Generate SMTP Credentials

SMTP credentials are required to send emails via OCI Email Delivery. Follow these steps:

  1. Log into the Oracle Cloud Console.
  2. Navigate to User Settings.
  3. Scroll down to SMTP Credentials and generate new credentials.
  4. Copy and store the username and password (as they won't be visible again).

2. Create Your Email Domain

To authenticate your emails, set up an email domain:

  1. In the Oracle Cloud Console, go to Developer Services > Email Delivery.
  2. Click Email Domains and create a domain.
  3. If setting up DKIM and SPF, choose a DNS domain that you own.

3. Set Up DKIM Authentication

DomainKeys Identified Mail (DKIM) allows email receivers (e.g., Gmail, Microsoft) to verify the authenticity of your email domain.

  1. Navigate to Email Domains > DKIM and create a DKIM key.
  2. Generate a DKIM record and add a CNAME record to your DNS provider.
  3. Once verified, your DKIM status changes to Active.

DKIM Configuration in OCI

4. Create an Approved Sender

All "From" email addresses must be registered as approved senders:

  1. In the Oracle Cloud Console, go to Email Delivery.
  2. Under DKIM, find Approved Senders and create one.

5. Configure SPF Records

Sender Policy Framework (SPF) prevents email spoofing by allowing only authorized servers to send emails from your domain.

  1. Navigate to your approved sender domain.
  2. Copy the SPF TXT record values and add them to your DNS settings.
  3. Once verified, DKIM and SPF authentication will be enabled.

SPF Configuration in OCI

6. Configuring SMTP Connection

To send emails, configure your SMTP connection:

  • Public endpoint: The SMTP server to connect to.
  • SMTP ports: Use 587 for TLS encryption (recommended).
  • Security: TLS encryption is required for sending emails securely.

7. Sending an Email with Python

Now that everything is set up, let's send an email using Python and the smtplib library:

import smtplib 
import email.utils
from email.message import EmailMessage
import ssl

SENDER = 'support@exampleplus.com'
SENDERNAME = 'Support Team'
RECIPIENT = 'Recipient Email Address'
USERNAME_SMTP = 'Provide your user SMTP'
HOST = "smtp.us-ashburn-1.oraclecloud.com"
PORT = 587
SUBJECT = 'Email Delivery Test (Python smtplib)'
BODY_TEXT = (
"This email was sent through the Email Delivery SMTP "
"Interface using the Python smtplib package."
)
password_smtp = '<Replace with Password>'

msg = EmailMessage()
msg['Subject'] = SUBJECT
msg['From'] = email.utils.formataddr((SENDERNAME, SENDER))
msg['To'] = RECIPIENT
msg.add_alternative(BODY_TEXT, subtype='text')

try:
server = smtplib.SMTP(HOST, PORT)
server.ehlo()
server.starttls(context=ssl.create_default_context())
server.ehlo()
server.login(USERNAME_SMTP, password_smtp)
server.sendmail(SENDER, RECIPIENT, msg.as_string())
server.close()
except Exception as e:
print(f"Error: {e}")
else:
print("Email successfully sent!")

8. Run the script with:

python3 ociemail.py

And you should see the message "Email successfully sent!".

Monitoring and Best Practices

  1. Suppression List
    OCI Email Delivery maintains a suppression list to prevent sending emails to addresses with permanent failures.

  2. Volume Testing
    To test email sending at scale, use:

    • 'discard.oracle.com': A special domain that accepts emails but does not deliver them.
    • Non-existent domains: Helps test bounce processing.

Conclusion

OCI Email Delivery provides a robust, scalable solution for sending transactional and bulk emails. We covered setting up email authentication, configuring SMTP, and sending a test email using Python. By following best practices and monitoring email performance, you can ensure reliable email delivery for your applications.

Call to Action

Choosing the right platform depends on your organizations needs. For more insights, subscribe to our newsletter for insights on cloud computing, tips, and the latest trends in technology. or follow our video series on cloud comparisons.

Interested in having your organization setup on cloud? If yes, please contact us and we'll be more than glad to help you embark on cloud journey.

Interested in getting a domain and business email? Checkout: Domain Registration and Business Email

Master Website Hosting on Oracle Cloud: Effortless Setup with Object Storage and API Gateway!

· 7 min read

Introduction


In today's digital age, a strong online presence is crucial for businesses and individuals alike. Hosting your website on the cloud offers unmatched scalability, reliability, and performance. Oracle Cloud Infrastructure (OCI) provides a robust and cost-effective solution for website hosting using Object Storage and API Gateway. This blog will walk you through the entire process, offering insights, tips, and best practices for seamless website hosting on OCI.


Why Choose Oracle Cloud for Website Hosting?


  • Scalability: Easily scale your website as traffic grows without worrying about hardware limitations.
  • Cost-Effective: Pay only for the resources you use, with no upfront costs.
  • High Availability: With OCI's global data centers, ensure your website is always accessible.
  • Enhanced Security: Advanced security features like encryption, firewall, and monitoring.


Key Components for Website Hosting on OCI


  1. Object Storage: Used to store and serve static files like HTML, CSS, JS, and media.
  2. API Gateway: Acts as a reverse proxy, enabling secure and scalable access to your website.
  3. DNS Configuration: Ensures your domain points correctly to your hosted site.
  4. IAM Policies: Manage access and permissions securely.

Following diagram shows the architecture that will be setup:

Architecture Diagram


Step-by-Step Guide to Host Your Website on Oracle Cloud


1. Set Up an Oracle Cloud Account


  • Sign up for a free Oracle Cloud account, which includes free credits to get started.
  • Configure your tenancy, compartments, and IAM settings.

2. Create a Virtual Cloud Network (VCN)


A Virtual Cloud Network (VCN) is a customizable and private network in Oracle Cloud Infrastructure. It is a fundamental component for any cloud deployment, including hosting a website. Here's how to create a VCN using the Oracle Cloud VCN Wizard:


Steps to Create a VCN:


  1. Navigate to the VCN Dashboard: Go to the Networking section in the OCI console.
  2. Choose the VCN Wizard: The wizard simplifies the setup by automatically creating necessary components like subnets, route tables, internet gateways, and NAT gateways.
  3. Enter Network Details:
    • Name: 'StaticWebsiteVCN'
    • CIDR Block: '10.2.0.0/16'
    • Subnet Types: Public and Private subnets
    • Public Subnet CIDR: '10.2.1.0/24'
    • Private Subnet CIDR: '10.2.2.0/24'
    • Internet Gateway: Automatic creation
    • NAT Gateway: Configured for private subnet internet access
  4. Select Internet Connectivity: Ensure the Internet Gateway is configured for the public subnet, and the NAT Gateway is in place for private subnet resources.
  5. Review and Create: Double-check the configurations, ensure security lists and route tables are correctly set up, and create the VCN.

3. Configure Security Lists

Security lists act as virtual firewalls for your VCN subnets. To allow HTTP/HTTPS traffic, follow these steps:


  1. Access Security Lists: Navigate to the security lists associated with your public subnet.
  2. Add Ingress Rules:
    • Source Type: CIDR
    • Source CIDR: 0.0.0.0/0 (for public access)
    • Allowed Ports: 80 (HTTP) and 443 (HTTPS)
    • Port 22: Allow for SSH access if needed
  3. Save the Rules: Apply the changes to allow internet traffic to your web application.

4. Set Up Object Storage


Oracle's Object Storage is ideal for hosting static website files such as HTML, CSS, JS, and media files.


How to Create and Configure Object Storage:


  1. Create a Bucket:
    • Name: StaticWebsiteBucket
    • Storage Type: Standard
    • Set Object Versioning if needed
  2. Upload Files:
    • Manually upload files or use the Oracle CLI for batch uploads.
    • Create folders (e.g., CSS, JS, images) if needed.
    • Ensure all files are correctly named and accessible
  3. Generate Pre-Authenticated Requests (PARs):
    • Allow API Gateway to securely access files.
    • Set up read-only access to the entire bucket or specific files.
    • Maintain a list of PAR URLs for easy management and updating

5. Configure API Gateway


The API Gateway serves as the front-end for your hosted website. It handles routing, security, and resource management.


Steps to Set Up the API Gateway:


  1. Create an API Gateway:
    • Choose the public subnet from the VCN created earlier.
    • Configure API endpoints and deployment settings.
    • Define the deployment name and the route base path as '/'
  2. Define Backend Routes:
    • Map routes to Object Storage using the PAR URLs.
    • Configure paths for 'index.html', '.js', '.css', '*.jpeg', and other static assets.
    • Use wildcards to simplify routing, e.g., '.css', '.js', '*.jpeg'
  3. Deploy and Test:
    • Test the deployment by accessing the API endpoint via a browser.
    • Validate that all assets load correctly and that the website is fully functional.
    • Monitor API calls and traffic through the API Gateway dashboard

6. Set Up DNS and SSL


For a professional and secure website, setting up DNS and SSL is critical.


  1. DNS Configuration:
    • Point your domain to the API Gateway's public endpoint.
    • Use Oracle Cloud's DNS service or an external DNS provider.
    • Configure CNAME or A records as necessary
  2. Enable SSL (Optional):
    • Set up an SSL certificate on the API Gateway.
    • Configure HTTPS routing to secure all web traffic.
    • Consider using Let's Encrypt or a third-party SSL provider

Best Practices for Website Hosting on OCI


  • Use Caching: Implement caching strategies to reduce latency.
  • Monitor Performance: Set up alerts and dashboards for real-time monitoring.
  • Backup and Recovery: Regularly back up your Object Storage data.
  • Optimize Costs: Use lifecycle management policies to reduce storage costs.
  • Use Pre-Authenticated Requests Wisely: Only expose necessary files to reduce security risks.
  • Test Extensively: Before going live, thoroughly test all endpoints and resources

Common Pitfalls and Troubleshooting


  1. Deployment Issues: Ensure that the VCN and API Gateway are correctly configured.
  2. File Not Found Errors: Double-check the bucket paths and pre-authenticated request (PAR) links.
  3. Access Denied: Validate IAM policies and public access settings for Object Storage.
  4. SSL Certificate Issues: Verify SSL configuration on API Gateway if HTTPS is not working.
  5. Network Configuration: Ensure that security lists and route tables are not blocking traffic

Conclusion


Oracle Cloud offers a powerful platform for hosting websites with minimal effort and maximum benefits. By leveraging Object Storage and API Gateway, you can create a scalable, secure, and high-performance website hosting solution. Follow the steps outlined in this guide to master website hosting on Oracle Cloud and take your online presence to the next level.

Please reach out to us for any of your cloud requirements


Ready to take your cloud infrastructure to the next level? Please Contact Us

Additional Resources




🔚 Call to Action


Choosing the right platform depends on your organizations needs. For more insights, subscribe to our newsletter for insights on cloud computing, tips, and the latest trends in technology. or follow our video series on cloud comparisons.


Interested in having your organization setup on cloud? If yes, please contact us and we'll be more than glad to help you embark on cloud journey.


💬 Comment below:
How is your experience with Mac on EC2? What do you want us to review next?


Top 10 Cloud Myths for AWS, Azure, GCP & OCI: Debunking Misconceptions for Cloud Success

· 7 min read


In this blog, we bust several common cloud myths that can lead to misconceptions about cloud costs, scalability, and security. Whether you're contemplating a move to the cloud or optimizing your current setup, understanding these myths will help you make more informed decisions.


Blog contents can also be found in below video:



Myth 1: There Is Nothing Free in Cloud


Cloud providers advertise free tiers—such as AWS's 750 hours, Oracle's limited VMs, or GCP's region-restricted offerings—to help you get started. However, these free aspects are subject to limits and only last for a specific period. Once you exceed these thresholds, charges begin to apply. It's important to know what truly is free and where the costs might creep in.


Example & Use Case:


A startup may begin with the free tier to test a proof-of-concept, only to later incur unexpected costs once their usage exceeds the free limits. For example, AWS's free 750 hours for EC2 might not cover additional services (like data transfer or storage), so planning and monitoring usage is key.


Myth 2: Setting Up a VPC Is Free


While you can create a Virtual Private Cloud (or virtual network) without an upfront fee, additional components such as public IP addresses or extra subnets may incur charges. Even though the logical setup is free, the associated resources can result in nominal but recurring costs.


Example & Use Case:


A company may design its architecture with a free VPC but later add multiple public IP addresses for load balancing or additional subnets for segmentation. These extra resources incur costs that add up over time, making it essential to review your architecture for hidden charges.


Myth 3: Stopped Instances Mean No Charges


A common misconception is that stopping a compute instance completely halts all charges. In reality, while the compute cost stops, you still pay for attached storage (like AWS EBS, Azure managed disks, or GCP persistent disks) and any allocated public IP addresses. To truly avoid charges, you must ensure that all associated resources are properly terminated.


Example & Use Case:


Consider a scenario where an organization stops its virtual machines overnight to save money. If the attached storage volumes remain allocated, the company still incurs storage charges. Properly detaching or deleting these resources can help avoid unexpected costs.


Myth 4: Private Endpoints Are Faster and More Secure


Private endpoints keep traffic within a cloud provider's network, avoiding the public internet. Although this can enhance security, they may introduce extra latency due to additional routing hops and incur hourly costs. Moreover, they often require manual routing adjustments. Thus, while beneficial for security, the trade-offs should be carefully considered.


Example & Use Case:


A financial institution might use private endpoints to secure sensitive transactions, but during high-traffic periods, the extra routing could add latency. Evaluating the performance impact against the security benefits helps determine the best approach.


Myth 5: Storage Is Inherently Cheap


At first glance, cloud storage may seem economical. However, the cost can escalate quickly if not managed properly. Different storage types (such as hot, cold, or archival tiers) have varied pricing, and additional services like snapshots or verbose log retention can further drive up expenses. Implementing proper lifecycle policies and choosing the right storage tier are essential to keep costs under control.


Example & Use Case:


A media company storing terabytes of video content might start on a standard storage tier, but as their archive grows, they may benefit from moving older files to a cheaper, cold storage tier. Proper planning for data lifecycle management is essential.


Myth 6: Cloud Can Scale Indefinitely Without Limits


Cloud platforms offer impressive scalability, but they come with both soft and hard limits. For instance, you might be constrained by limits on vCPUs, instance counts, or specialized resources (like GPUs for AI/ML). It is crucial to review your provider's quotas and plan accordingly to avoid unexpected capacity issues.


Example & Use Case:


During a major product launch, an e-commerce platform might hit their cloud provider’s vCPU limit, causing performance bottlenecks. By pre-planning and requesting quota increases, they can ensure smooth scaling during peak demand.


Myth 7: Not Being on Cloud Means You're Not Modern


Modern architectures—microservices, serverless, or containerized deployments—are not exclusive to cloud environments. On-premises solutions can also be engineered to be modern and scalable. The key lies in adopting the right architecture and management practices, regardless of where your applications run.


Example & Use Case:


A traditional enterprise may modernize its on-premises infrastructure by implementing container orchestration with Kubernetes, achieving many of the benefits touted by cloud-native systems without migrating entirely to the cloud.


Myth 8: Cloud Is Cheap by Default


Migrating to the cloud often shifts spending from capital expenditure (CAPEX) to operational expenditure (OPEX). While this can lower upfront costs, without proper management—such as autoscaling, cost monitoring, and resource optimization—operational costs can quickly add up. Cloud is cost-effective only when managed strategically.


Example & Use Case:


An organization that moved to the cloud without configuring autoscaling and cost alerts may see their monthly bills spike unexpectedly. Regular monitoring and implementing cost control measures are essential to realize the financial benefits of the cloud.


Myth 9: A Single Cloud Strategy Is Sufficient


Relying solely on one cloud provider may lead to vendor lock-in and limit your flexibility. A multi-cloud approach allows you to leverage the best features of different providers, enhances resilience, and provides better negotiation power for pricing and discounts.


Example & Use Case:


A multinational corporation may adopt a multi-cloud strategy to mitigate risks associated with downtime or regional issues. By distributing workloads across different providers, they improve resilience and avoid dependency on a single vendor.


Myth 10: Cloud Automatically Ensures Security


Cloud security follows a shared responsibility model. Although cloud providers secure the underlying infrastructure, you remain responsible for securing your applications, data, and configurations. Implementing best practices—such as encryption at rest and in transit, using custom-managed keys, and regular security audits—is critical for protecting your assets.


Example & Use Case:


A company that assumed cloud security was fully managed by their provider suffered a data breach due to misconfigured access controls. This incident highlights the need for continuous security oversight and adherence to best practices.


Conclusion


Understanding these common cloud myths is essential for making smart decisions when migrating or optimizing your cloud environment. Cloud computing offers powerful benefits, but only when you plan, monitor, and manage your resources effectively. If you have any questions or need further guidance, please drop a comment below. And remember to like, subscribe, and share our content for more insights into cloud technologies.


Call to Action


Choosing the right platform depends on your organizations needs. For more insights, subscribe to our newsletter for insights on cloud computing, tips, and the latest trends in technology. or follow our video series on cloud comparisons.


Interested in having your organization setup on cloud? If yes, please contact us and we'll be more than glad to help you embark on cloud journey.


Call to Action


Choosing the right platform depends on your organizations needs. For more insights, subscribe to our newsletter for insights on cloud computing, tips, and the latest trends in technology. or follow our video series on cloud comparisons.


Interested in having your organization setup on cloud? If yes, please contact us and we'll be more than glad to help you embark on cloud journey.